In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Sparks-R-Fun wrote: Andrea, To restart the game, simply run the Start section of code again. To know when to restart the game you will want to wait until someone wins, then make sure all of the buttons are released. To know when someone wins the game, set a bit flag. Try adding "AlreadyWon VAR BIT" to your variable declaration section. Then add "AlreadyWon = 1" to the ISR_Exit section. (I think it is ok to treat an error condition as a winner in this case.) Now all you need to do is continually check for a winner and then check for all the buttons to be released. Try adding this section of code right before the final "END" statement. [CODE]Check_for_a_Winner: IF AlreadyWon = 1 THEN ' Check for an existing winner. Winner = Buttons AND %00001111 ' Mask out unused buttons. IF Winner = %00001111 Then ' Check for no buttons pressed. GOTO Start ' Reset the game display ENDIF ENDIF GOTO Check_for_a_Winner ' Continuously check for a winner.[/CODE] This might work one time. (I have not actually tested this. I am just sharing my thoughts to help point you toward one possible solution.) After that you might realize that you have not yet included a means to reset the winner flag once it has been set. To do this add "AlreadyWon = 0" to the Start section of code so that each time the game is (re)started the winner flag is cleared. I do not know if this will actually work, but it should get you close. Let us know if you need more help. - Sparks ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=240024#m240213 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)