Number Game

Simo7007

New Member
I'm thinking of making a "Simon Says" type game but instead of random colours, a series of numbers are displayed, starting with a few 4 digit numbers, then 6, the 8, ect. ect. then you have to remember them and then re-input, so, 4321 would display on a screen, press enter to continue <enter> then you have to remember the numbers to continue to the next level.
I have the components to put this together, but I'm short of a code. I have got as far as producing a random code and then relaying it back but I'm struggling with the whole code concept.
 

nick12ab

Senior Member
Why do people always post questions in the Finished User PICAXE Projects area?

In that Simon Says game, when moving onto the next 'level', the current sequence is remembered and one more colour is added to the sequence. So wouldn't it be better to start with one digit then add more digits to that sequence? A single variable could easily hold two numbers of a sequence using BCD encoding and all modern PICAXEs have lots of memory so you're not going to run out of space even if you go the lazy route and use a whole 8-bit variable per digit, however you will need to use the bptr, @bptr etc. addressing system but that's not hard.

A PICAXE-28X2/40X2 has a 1024 byte scratchpad, so you could use that to have a 2048-digit long sequence!

So you've already created your random code. Have you checked it to make sure that it is very random-ish (the PICAXE one linked above seems to be lacking this) rather than just repeating three or four numbers over again? It won't be very random if you just use a loop to continuously generate a random number and use an until condition to exit the loop once the number is single digit, then use that number as the seed next time. Rev-ed suggest using the time variable as a seed.

Have you got the keypad code done? Don't use up, down and OK buttons as the time it takes to use those will make the user forget even a short sequence of numbers.

Unfortunately, I cannot assist further until you tell me more about the hardware. Input device? Display device? (I hope not a serial 16x2 display, you're better off using a parallel one here)
 
Top