Computer Science Canada

RPG Help Program Finishing for no reason

Author:  FredB [ Mon Oct 31, 2016 11:48 am ]
Post subject:  RPG Help Program Finishing for no reason

What is it you are trying to achieve?
I am trying to find a solution to my program breaking (was working fine last week with no changes whatsoever)


What is the problem you are having?
The program is finishing for no reason on it's own after asking a yes no question to progress or return to a previous checkpoint


Describe what you have tried to solve this problem
Check out the processes that may be causing an issue


Please specify what version of Turing you are using
4.1.1

Author:  lordroba [ Mon Oct 31, 2016 9:51 pm ]
Post subject:  Re: RPG Help Program Finishing for no reason

It seems to work ok if you take out the 'exit' command'. I might suggest that you add 'if' conditions for capitalized answers and or where the first letter is capitalized. For example "YES" or "Yes". I accidentally missed the battle a couple of times by typing "Yes" instead of "yes". Razz Otherwise good game!

Turing:

if answer = "yes" then
     cls
     bossbattle
  else
    cls
    distance := 80
  end if
   %exit

Author:  FredB [ Tue Nov 01, 2016 8:28 am ]
Post subject:  Re: RPG Help Program Finishing for no reason

lordroba @ Mon Oct 31, 2016 9:51 pm wrote:
It seems to work ok if you take out the 'exit' command'. I might suggest that you add 'if' conditions for capitalized answers and or where the first letter is capitalized. For example "YES" or "Yes". I accidentally missed the battle a couple of times by typing "Yes" instead of "yes". Razz Otherwise good game!

Turing:

if answer = "yes" then
     cls
     bossbattle
  else
    cls
    distance := 80
  end if
   %exit


Ah, I just noticed I forgot to add in the Str.Lower (answer) line in there, thanks a lot!


: