View Full Version : Simple game written in JavaScript

02-15-2007, 09:13 PM
Just starting out with JS...

I'm sure there's ways to shorten this down, but I'm fairly pleased with it


Any suggestions / pointers would be welcome...

02-15-2007, 10:19 PM
Alert boxes are very annoying. Try writing out information to the screen. Also, why does it switch to black?

02-18-2007, 04:39 PM
Alert boxes are very annoying.I agree

Try writing out information to the screen.Haven't learned how yet... I think that's two chapters ahead of where I'm at now. As soon as I learn how I will... Well probably not to that script as it was just an example of where I was at at that point....

Also, why does it switch to black?seemed like the easiest way to hide the instructions.

I've started a new script, need to add a timer to it. It's a clone of a "Digitor" machine... (http://www.jetshack.com/digitor.htm)

Choose a type of math problem then you're presented with 10 of those problems. the score is kept and then presented after the final question is answered.

generates 2 random numbers (currently with a max value of 12)

addition problems were straight forward
subtraction problems are tested to make sure that the first number is larger than the second number so that there aren't any negative answers.
multiplication problems were straight forward.
division problems - multiplied the 2 random numbers together to get the dividend then use the dividend and one of the 2 random numbers in the problem. This makes sure that you end up with simple integers.


02-20-2007, 06:35 AM
I agree about the black, and the alerts, though I can understand using alerts. The black is just confusing. uh... what do I do now? Etc.

02-22-2007, 08:34 PM
It's getting better...