First off, I am assuming that you:
1. Don't indent your code, as that would have made it easier to find the problem. For instance:
This
If a=1
a=7
b=11
c=3
print "Yes"
endif
It would look like this
If a=1
a=7
b=11
c=3
print "Yes"
endif
2. Came from another language of BASIC recently (or other languages I guess, not too familiar with others)
Here is the problem:
You are using If-THEN's. In DBC, using then shows that that if statement is only 1 line long and it should do only what is after the then (thus the endif command isn't necessary).
So your logic is basically whatever they press, it will clear the screen then continue on with the program.
To fix it, change this:
if ans1$ = "a" then cls
print "Going back to sleep at a time like this was a bad idea. You died of your injuries and exposure."
input "Press <Enter> to restart";restart$
if restart$ = "" then cls
To:
if ans1$ = "a"
cls
print "Going back to sleep at a time like this was a bad idea. You died of your injuries and exposure."
input "Press <Enter> to restart";restart$
if restart$ = "" then cls
REM Notice how I left this one as an If-then instead of If-endif. This is because there is only one thing for it to do with the if
endif
You would have to do it with ans1$="b" too but it is the same procedure.
Other things I noticed:
gosub start: ------You don't need the :, only when you place the label itself
if restart$="" -----What if the player types something? A better way would be to say press enter, then just use a wait key instead
if ans1$="a" ------DBC IS case sensitive. A<>a so if the player types A, nothing would happen. To fix, use upper$() or lower$(), it really doesn't matter which you use.
input "Press <Enter> to restart";restart$ ------If comfortable with subroutines, you could just make this a subroutine since it is the same thing for both cases, then just put a gosub instead of the same 2 lines of code.
Big shortcut, though slightly more complex and you shouldn't do it if you aren't sure how to use it (it will just make it worse...trust me) is the select-endselect command. It will change this:
If a$="1"
DO STUFF
endif
If a$="2"
DO STUFF
endif
If a$="3"
DO STUFF
endif
If a$="4"
DO STUFF
endif
To this:
Select a$
case "1": DO STUFF : endcase
NOTE YOU CAN BREAK IT UP INTO BLOCKS LIKE IF THENS, BUT SINGLE LINES ARE A LITTLE CLEANER LOOKING
case "2": DO STUFF : endcase
case "3": DO STUFF : endcase
case "4": DO STUFF : endcase
case default: DO STUFF IN CASE a$ DOESN'T EQUAL ANY OTHERS
endselect
So yeah, those are a few suggestions, you don't have to do any, just wanted to point them out as possibilities if you are feeling adventurous. For more info on select, it is in the main help under BASIC
Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?