Hello,
I'm actually surprised this would run at all in DBC. For one, you are using the comment indicator '//' which doesn't exist in DBC and will cause an error. To turn a single line into a comment either use
rem blah blah blah
or
use the reverse single quote (the key next to the 1 key)
` blah blah blah
If you want to add a comment on the same line after code, then separte the code and the comment with a ':'
wait 1500 : rem Wait for 1.5 seconds
To remoark entire blocks of text use
And number 2, in your function:
function playagain()
print "Would you like to play again? Y/N"
wait key
if inkey$()="y" then gosub game else end
endfunction
You have a reference to 'game' which does not exist inside the function. Any labels for subroutines referenced inside a function, must be created inside the function. You are trying to gosub to a label that exists in the main program outside of the function. The function cannot recognize this.
And in general, if you have huge lists of choices that depend on the value of a single variable, you can use the Select Case command combination. If you use C or C++, it is similar to the switch case combo:
input "Type in a number between 1 and 9 - ", playerP
select playerP
case 1 : print "You have chosen Bulbasaur" : endcase
case 2 : print "You have chosen Ivysaur" : endcase
case 3 : print "You have chosen Venusaur" : endcase
etc...
case default
print "You did not enter a valid number"
gosub game
endcase
endselect
Enjoy your day.