Skip to content

Instantly share code, notes, and snippets.

@bnates
Created December 5, 2017 00:19
Show Gist options
  • Save bnates/bd3bfdc716fe0bc79a2ffe138fd2a9f6 to your computer and use it in GitHub Desktop.
Save bnates/bd3bfdc716fe0bc79a2ffe138fd2a9f6 to your computer and use it in GitHub Desktop.
guessing.html
<!DOCTYPE html>
<html>
<head>
<title>Welcome to 101</title>
</head>
<body>
<h1>Guessing Game!</h1>
<script>
var user = prompt('what is your name?');
console.log(user);
alert('Hi there ' + user + ', I\'m going to ask you a question.');
var answer = prompt(user + ', this is a yes/no question. Please answer with Y or N. Do you love coding?');
console.log('my users answer:', answer);
if (answer === 'Y') {
alert('yay! i love coding too!');
} else {
alert('well, you prolly should not be in 201');
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment