From 5cd3c808d9ad77389ce400ae4740fa50406ead17 Mon Sep 17 00:00:00 2001 From: RohanPandula Date: Fri, 28 Feb 2014 14:35:07 -0500 Subject: [PATCH] challenge completed --- js/app.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 7374f4e..197442a 100755 --- a/js/app.js +++ b/js/app.js @@ -1 +1,13 @@ -alert('Hey find me to know where to put the javascript'); +//alert('Hey find me to know where to put the javascript'); +var winning_num = Math.floor((Math.random()*100)+1) +var user_name = prompt("What is your name?") +var guess = prompt("Guess a random number between 1 and 100") + + + +if (guess == winning_num){ + alert("YOU WIN! "+user_name) +} +else { + alert("You lose "+user_name) +}