Hi, I have made a kit from reved, a simon says game...
I have an impatient daughter wanting to give it a try!!!.
I attempted a download of the simon says.bas from the samples folder of the picaxe suite and the sytax checker informs me there is a bug in the code..
It says this.. and wont let me program the board..
loop: if pin7 = 1 then pushed0
^
Error: Loop without Do
It is from this section of the code..
' *** Section 4 *****************************************
' *** This section detects the players reply sequence ***
' *******************************************************
' now the user responds
' reset the players position to 1
playerstep = 1
gameloop:
' if playerstep is greater than topstep then all done
if playerstep > topstep then success
' get the correct key value is supposed to hit
' from the EEPROM memory
read playerstep,value
' now wait for switch to be pressed
loop: if pin7 = 1 then pushed0
if pin0 = 1 then pushed1
if pin1 = 1 then pushed2
if pin6 = 1 then pushed3
goto loop
' switch pressed so check it is the correct one
' if it is make a beep sound and then continue
' else fail the game
pushed0:
if value <> 0 then fail
let playerstep = playerstep + 1
gosub beep
goto gameloop
pushed1:
if value <> 1 then fail
let playerstep = playerstep + 1
gosub beep
goto gameloop
pushed2:
if value <> 2 then fail
let playerstep = playerstep + 1
gosub beep
goto gameloop
pushed3:
if value <> 3 then fail
let playerstep = playerstep + 1
gosub beep
goto gameloop
' *** Failed so make noise and jump back to start ***
' failed so make failed noise, switch off all LEDs
' and go back to start
fail:
let pins = %0000000 ' all LEDs off
sound 7,(80,100) ' make a noise
sound 7,(50,100)
goto init ' back to start
Any takers on a fix . The daughter frankly has already wrote this off, nice one dad...not
I have an impatient daughter wanting to give it a try!!!.
I attempted a download of the simon says.bas from the samples folder of the picaxe suite and the sytax checker informs me there is a bug in the code..
It says this.. and wont let me program the board..
loop: if pin7 = 1 then pushed0
^
Error: Loop without Do
It is from this section of the code..
' *** Section 4 *****************************************
' *** This section detects the players reply sequence ***
' *******************************************************
' now the user responds
' reset the players position to 1
playerstep = 1
gameloop:
' if playerstep is greater than topstep then all done
if playerstep > topstep then success
' get the correct key value is supposed to hit
' from the EEPROM memory
read playerstep,value
' now wait for switch to be pressed
loop: if pin7 = 1 then pushed0
if pin0 = 1 then pushed1
if pin1 = 1 then pushed2
if pin6 = 1 then pushed3
goto loop
' switch pressed so check it is the correct one
' if it is make a beep sound and then continue
' else fail the game
pushed0:
if value <> 0 then fail
let playerstep = playerstep + 1
gosub beep
goto gameloop
pushed1:
if value <> 1 then fail
let playerstep = playerstep + 1
gosub beep
goto gameloop
pushed2:
if value <> 2 then fail
let playerstep = playerstep + 1
gosub beep
goto gameloop
pushed3:
if value <> 3 then fail
let playerstep = playerstep + 1
gosub beep
goto gameloop
' *** Failed so make noise and jump back to start ***
' failed so make failed noise, switch off all LEDs
' and go back to start
fail:
let pins = %0000000 ' all LEDs off
sound 7,(80,100) ' make a noise
sound 7,(50,100)
goto init ' back to start
Any takers on a fix . The daughter frankly has already wrote this off, nice one dad...not