Break Command Help
Author |
Message |
Planet_Fall
![](http://compsci.ca/v3/uploads/user_avatars/94411884552bb34e1c9bf4.png)
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Planet_Fall
![](http://compsci.ca/v3/uploads/user_avatars/94411884552bb34e1c9bf4.png)
|
Posted: 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 Very Happy](http://compsci.ca/v3/images/smiles/icon_biggrin.gif) |
|
|
|
|
![](images/spacer.gif) |
|
|