Sat Nov 10, 2012 12:23 am
//this is my function for random numbers//
var random = function(least,most){
return Math.floor(Math.random()*most + least);
};
//end of function//
var c;
var score=0;
confirm("New game");
console.log("new game");
var added = "";
for(c=1;c<=10;c++){
var num1=random(1,10);
var num2=random(1,10);
if(parseInt(prompt(added +"What is"+num1+"+"+num2+"?"))===(num1+num2)){
score++;
added="corect. You have "+score+" points ";
}
else{
added="wrong You have "+score+" points ";
}
Sat Nov 10, 2012 12:47 pm
Sat Nov 10, 2012 4:31 pm
Sun Nov 11, 2012 3:19 pm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.