
-----------------------------------
anywho_ya
Thu May 06, 2004 12:47 pm

Restarting game
-----------------------------------
How do i re-start the game. For example if they lose how do i create something to let them have the choice to try again

-----------------------------------
Paul
Thu May 06, 2004 2:30 pm


-----------------------------------

var choice: string(1)
loop
program

put "Start again? (Y/N)"
getch (choice)
if choice = "N" or choice = "n" then
exit
end if
end loop


-----------------------------------
Martin
Mon May 10, 2004 12:58 am


-----------------------------------
To restart a game, you have to reset all of the variables to their default value. For example
loop
 if n = 1 then
   resetvars // reset all of the variables; this is a procedure
   newgame // this is a procedure, so once it is done it can be assumed that the game is finished
 elsif n = 2 then
  exit
 end if
end loop
