Hey everyone, I have fiddling with this and im obviously missing something essential. If I do randInt(1,13)->B and then do multiple if commands involving B being between different numbers it keeps executing the commands under ever if statement. I have tried using if, then, end statements but it still displays all commands. Thanks for any help, but please remember I'm still pretty bad at programming so try to not make things to complicated. :)
Have you tried anything with labels yet?
I have, but I'm not using labels in this program. Here is the program I have
:Disp "GOT A DISEASE"
:Disp "GOT INJURED FROM"
:Disp "AN IDIAN ATTACK"
:Disp "IS FREEZING"
:Disp "GOT RUN OVER"
:Disp "GOT IN A FIGHT"
:Disp "WAS SHOT IN A"
:Disp "GOT SCURVY"
:Disp "IS EXHAUSTED"
:Disp " "
Every time I run it I get this:
DAISY (What I have inputed as Str4)
GOT A DISEASE
GOT INJURED FROM
AN INDIAN ATTACK
All help is appreciated.
In BASIC, you can't do something like If 2<=B<=5:Then because it will evaluate it like (2<=B)<=5 which if B is greater than or equal to 2 will always be true. Say B is 3. 2<=B will result in 1 because of the calculator's logic-handling, so then it will evaluate 1<=5 which is true, so whatever code is after it will be executed. You need to do this, instead: If 2<=B and B<=5.
EDIT: Also, as an optimization, you can do Disp "Text 1","Text 2" instead of going to a new line and putting Disp again (you can also leave the quote off of the final string if you do it that way, i.e. Disp "1","2).
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future