Skip to content

Commit

Permalink
updated the game
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasir-Mohamud committed Feb 6, 2020
1 parent ef2f7c3 commit 4eeb1e3
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 20 deletions.
107 changes: 88 additions & 19 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,114 @@
/* eslint-disable no-unreachable */
/* eslint-disable eqeqeq */
'use strict';
var score = 0;
var user = prompt('What is your name?');
alert('Welcome ' + user);

var age = prompt(' Are you over 21 ?');
if (age.toLowerCase() === 'yes') {
// question 1
var age = prompt('Is the sky blue ?').toLowerCase();
if (age === 'yes') {
//console.log('You are old enough to LEGALLY drink!');
alert('You are old enough to LEGALLY drink!');
} else if (age.toLowerCase() === 'no') {
alert('correct');
score++;
} else if (age === 'no') {
//console.log('You are still to young :(');
alert('You are still to young :(');
alert('wrong');
}
var graduate = prompt('Did you graduate high school?');
if (graduate.toLowerCase() === 'yes') {

//question 2
var days = prompt('Are there 7 days in a week').toLowerCase();
if (days === 'yes') {
//console.log('Congrats on finishing high school!');
alert('Congrats on finishing high school!');
} else if (graduate.toLowerCase() === 'no') {
alert('correct');
score++;
} else if (days === 'no') {
//console.log('You did not gradute');
alert('You did not gradute');
alert('wrong');
}
var anime = prompt('Do you watch Anime?');

//question 3
var anime = prompt('Is Anime fun?');
if (anime.toLowerCase() === 'yes') {
//console.log('I watch Anime too!');
alert('I watch Anime too!');
alert('correct');
score++;
} else if (anime.toLowerCase() === 'no') {
//console.log('You should start watching it');
alert('You should start watching it');
alert('wrong');
}
var sports = prompt('Do you watch or play sports?');

//questiion 4
var sports = prompt('is basketball a sport');
if (sports.toLowerCase() === 'yes') {
// console.log('I love to watch or play sports as well');
alert('I love to watch or play sports as well');
alert('correct');
score++;
} else if (sports.toLowerCase() === 'no') {
//console.log('great to know');
alert('great to know');
alert('wrong');
}
//question 5
var coding = prompt('Is the first week of coding hard for you?');
if (coding.toLowerCase() === 'yes') {
// console.log('Everything in life starts off hard');
alert('Everything in life starts off hard');
alert('correct');
score++;
} else if (coding.toLowerCase() === 'no') {
// console.log('Well the second is harder : ) ');
alert('Well the second is harder : )');
alert('wrong');
}

//question 6
for (var i = 0; i < 4; i++ ) {
var correct = 7;
var num = prompt('Can you guess a number between 1 and 10');
if ( num == correct) {
alert('GOOD JOB! Youre answer is correct');
break;
// eslint-disable-next-line no-unreachable
score++;
} else if (num < correct) {
alert('Too low ');
} else if (num > correct) {
alert('Too high');
}


}
alert('Good-bye ' + user);


alert('The correct answer is ' + correct);

//question 7
var isCorrect = false;

for (var j = 0 ; j < 6; j++){
var edu = prompt(' Name a computer software language ');
var lang = ['javascript' , 'python', 'asp.net', 'java'];
// eslint-disable-next-line no-redeclare
for (var i = 0; i < lang.length ; i++){
if (edu.toLowerCase() == lang[i]) {
alert('You are correct!');
isCorrect = true;
break;
// eslint-disable-next-line no-unreachable
score++;
}

}
break;

// eslint-disable-next-line eqeqeq
if (isCorrect == false){
alert('try again');
}

}
if (isCorrect == false > 6){
alert('answers are ' + lang);
}

alert('Your score is '+ score);


22 changes: 21 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,27 @@
</head>
<body>
<main>
<p>I am 20 years old. I was born in America and lived here for 10 years then I moved to Africa and lived there for 6 years and then I came backe to the states. I know 3 languages. I graduated high school in 2017 and I worked as a operator for The Seattle Great Wheel. Now I am at Code Fellows to become a software developer.</p>
<h1>Top 10 Anime</h1>
<ol>
<li>Naruto</li>
<li>Jojo's Bizarre Adventures</li>
<li>Beserk</li>
<li>Never Promised Land</li>
<li>One piece</li>
<li>Bleach</li>
<li>Killa Kill</li>
<li>Re:ZERO</li>
<li>Attack On Titans</li>
<li>Parasyte</li>
</ol>
<p>I am 20 years old. I was born in America and lived here for 10 years then I moved to Africa and lived there for 6 years and then I came backe to the states. I know 3 languages. </p>
<ul>Schools that i have attended from elementry to now are :
<li>White Center Heights Elementry</li>
<li>Zayed Primary School(Africa)</li>
<li>Abu Hureira Academy(freshmen year)</li>
<li>Chief Sealth International High School</li>
<li>South Seattle Community College</li>
</ul>

</main>
<script src='app.js'></script>
Expand Down

0 comments on commit 4eeb1e3

Please sign in to comment.