Computer Science Canada

Break Command Help

Author:  Planet_Fall [ Fri Jan 17, 2014 12:41 pm ]
Post subject:  Break Command Help

Break command issues

One I generated the .exe of the program I was writing, I decided to test it out. Problem is that when you get the GAME OVER screen the program just continues instead of terminating. How to I get it to terminate?

This is the area of code that isn't working, is there a different command instead of Break?

Turing:

put skip
put enemy.NAME, " attacks ", player.NAME, "!"
damage := enemy.ATK + Rand.Int (10, 25)
put enemy.NAME, " deals ", damage, " damage to ", player.NAME
HP_HOLDER -= damage
if HP_HOLDER <= 0 then
      cls
      put "GAME OVER"
      continue
      break
end if
put ""
put player.NAME, " attacks ", enemy.NAME, "!"
damage := player.ATK + Rand.Int (10, 25)
put player.NAME, " deals ", damage, " damage to ", enemy.NAME
enemy.HP -= damage
if enemy.HP <= 0 then
       put "YOU HAVE WON!"
       continue
       Battle_end
       HP_HOLDER := player.HP
       exit
end if
continue



Please specify what version of Turing you are using
Turing 4.1.1

Author:  Raknarg [ Fri Jan 17, 2014 1:05 pm ]
Post subject:  RE:Break Command Help

there's a command called quit.

Alternatively, you could just allow the program to reach the whitespace beyond, in which case it will have nothing left to read and end.

Author:  Planet_Fall [ Fri Jan 17, 2014 1:35 pm ]
Post subject:  Re: Break Command Help

Thanks! This helps a lot, with this my final project is now presentable! Your a life saver!! Very Happy


: