Skip to content
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
79 changes: 41 additions & 38 deletions Game.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Our Mini game</title>
<link rel="stylesheet" href="Style.css">
<script src="https://kit.fontawesome.com/ad4791524b.js" crossorigin="anonymous"></script>
</head>
<body>
<img src="Images/otaku-logo-resize.png" alt="Image of logo">
<nav>
<button class="hamburger" id="hamburger">
<i class= "fas fa-bars"></i>
</button>
<ul class="nav-ul" id="nav-ul">
<li><a href ="Index.html">Home</a></li>
<li><a href="MHA.html">My Hero Academia</a></li>
<li><a href="Naruto.html">Naruto</a></li>
<li><a href="SAO.html">Sword Art Online</a></li>
<li><a href="TopPicks.html">Recommendations</a></li>
<li><a href="About.html">About</a></li>
<li><a href="Contact.html">Contact Us</a></li>
<li><a href="Game.html">Mini-Game</a></li>
</ul>
<script src="Script.js"></script>
</nav>

<h1 class="intro">Guessing Number Game!</h1>
<p class="para2">Guess a number between 1-10!</p>
<p class="para2">Your opponent will be the compueter!</p>




</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Our Mini game</title>

<link rel="stylesheet" href="Style.css">
<script src="https://kit.fontawesome.com/ad4791524b.js" crossorigin="anonymous"></script>
</head>
<body>
<img src="Images/otaku-logo-resize.png" alt="Image of logo">
<nav>
<button class="hamburger" id="hamburger">
<i class= "fas fa-bars"></i>
</button>
<ul class="nav-ul" id="nav-ul">
<li><a href ="Index.html">Home</a></li>
<li><a href="MHA.html">My Hero Academia</a></li>
<li><a href="Naruto.html">Naruto</a></li>
<li><a href="SAO.html">Sword Art Online</a></li>
<li><a href="TopPicks.html">Recommendations</a></li>
<li><a href="About.html">About</a></li>
<li><a href="Contact.html">Contact Us</a></li>
<li><a href="Game.html">Mini-Game</a></li>
</ul>
<script src="Script.js"></script>
</nav>

<h1 class="intro">Guessing Number Game!</h1>
<p class="para2">Guess a number between 1-10!</p>
<p class="para2">Your opponent will be the compueter!</p>






</body>
</html>
2 changes: 2 additions & 0 deletions Index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -195,3 +196,4 @@ <h3 class="intro">Sign Up!</h3>
</div>
</body>
</html>

2 changes: 2 additions & 0 deletions MHA.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -117,3 +118,4 @@ <h4 class="intro">The League Of Villains</h4>
<footer></footer>
</body>
</html>

27 changes: 27 additions & 0 deletions Script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@

//Sean
function guessNum(){

var randNum = Math.floor(Math.random() * 30); //Uses randomisation,Uses number only from 1-10,it only returns integer values of this range

//This produces an output of the random number
print(randNum);

var userInput= prompt("Enter any number between 1-30");
//User inputs number ("Enter any number between 1-30+randNum")

if(userInput < randNum){
window.alert("Correct! you are right!");// this message will pop up if you guessed the number correctly

}else if(userInput > randNum){
window.alert(" You guessed it too low,you lose!");//This message pops up if you have guess it toow
}
else if (userInput == randNum){
window.alert("You guessed it too high,you lose!");
}
else{
window.alert("This is not valid,ERROR!"); //This message prints if the value is not an integer
}
}

//presley-JavaScript fr contact page
function validate(){
var formData = []; // array that holds data from the form fields
Expand Down Expand Up @@ -54,3 +80,4 @@ function validate(){
hamburger.addEventListener('click', () => {
nav.classList.toggle('show');
});

Loading