Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geek #2

Open
wants to merge 3 commits into
base: main-page
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions guess-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Личный сайт студента GeekBrains</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript">

function Play()
{
var answer = parseInt(Math.random() * 100);
var plyaerNum = 1;
while(true){
var userAnswer = prompt('Ходит игрок ' + plyaerNum + ' .Введите число от 0 до 100. Для выхода нажмите q');

if(userAnswer == 'q')
break;
if(userAnswer > answer){
alert('Ваше число слишком большое');
} else if(userAnswer < answer){
alert('Ваше число слишком маленькое');
} else if(userAnswer == answer){
alert('Вы угадали, поздравляю! Победил игрок номер ' + plyaerNum);
break;
}

if(plyaerNum == 1)
plyaerNum = 2;
else if(plyaerNum == 2)
plyaerNum = 1;
}

}

</script>
</head>
<body>
<div id="header">
<a href="index.html">Главная</a><span>/</span>
<a href="puzzle.html">Загадки</a><span>/</span>
<a href="#">Угадайка</a><span>/</span>
<a href="#">Угадайка мультиплеер</a><span>/</span>
</div>
<div id="content">
<h1>Личный сайт студента GeekBrains</h1>
<div id="center">
<h3>Угадайка мультиплеер</h3>
<div id="box">
<p>Играет 2 игра. У вас будет неограниченное количество попыток, чтобы угадать загадку.</p>
<br><br/>
<a href="#" onclick="Play();">Начать игру</a>
</div>
</div>

<div id="footer">
Copyright © 2016 <a href="https://geekbrains.ru/"> GeekBrains </a>
</div>

</body>
</html>
1 change: 1 addition & 0 deletions hey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello world
84 changes: 84 additions & 0 deletions puzzle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Личный сайт студента GeekBrains</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript">

var result = 0;

function AskQuestion(textBoxId, answer)
{
var userAnswer = document.getElementById(textBoxId).value;
if(userAnswer == answer)
result++;

}

function AskQuestions()
{
AskQuestion("userAnswer1", "капуста");
AskQuestion("userAnswer2", "елка");


if(result == 2)
alert('Вы угадали все загадки') ;
else if(result == 1)
alert('Вы угадали только одну загадку') ;
else
alert('Вы ничего не угадали');
}

/*function AskQuestions()
{
var userAnswer = document.getElementById("userAnswer1").value;
var result = 0;
if(userAnswer == "капуста")
result++;

userAnswer = document.getElementById("userAnswer2").value;
if(userAnswer == "елка")
result++;


if(result == 2)
alert('Вы угадали все загадки') ;
else if(result == 1)
alert('Вы угадали только одну загадку') ;
else
alert('Вы ничего не угадали');
}*/

</script>
</head>
<body>
<div id="header">
<a href="index.html">Главная</a><span>/</span>
<a href="#">Загадки</a><span>/</span>
<a href="#">Угадайка</a><span>/</span>
<a href="#">Угадайка мультиплеер</a><span>/</span>
</div>
<div id="content">
<h1>Личный сайт студента GeekBrains</h1>
<div id="center">
<h3>Игра в загадки</h3>
<div id="box">
<h5>Отгадай загадки!</h5>
<p>Сто одежек, и все без застежек</p>
<input type="text" id="userAnswer1">

<p>Зимой и летом одним цветом</p>
<input type="text" id="userAnswer2">

<br><br/>
<a href="#" onclick="AskQuestions();">Отправить</a>
</div>
</div>

<div id="footer">
Copyright © 2016 <a href="https://geekbrains.ru/"> GeekBrains </a>
</div>

</body>
</html>