Main AdOptional

//----------------------------------------------------

Tuesday, July 12, 2016

Game Theory -Making a game using HTML and JavaScript with blog

-:Game Theory :-

Making a game using HTML and JavaScript with blog


Here I will show you that how we can make a simple math game using HTML and Java Script with blogger to run on internet.

I build the following code to this game


explanation:- 
    function show_onclick():- This is a javascript function to calculate the right answer by checking the condition using if statements. In this we have find the correct number which generated by computer at the time of page load there are only 4 chance to get it. 

     var no1=Math.floor((Math.random() * 20) + 1);:- this is a code we use to generate a random number between 0 to 20.

   <input type="button" onClick="show_onclick()" value="submit"/> :- This is a code of submit button , when we press this button control transfer to the javascript function named show_onclick()..
You can play game by click here..

-----------------------------------------------------------------------------

No comments:

Post a Comment