First of all, i would like to see goodday to you because this is my first post and topic at this forum.
When i use two or more IF commands, it uses the last one, i'll give an example. I'm making an simple dartbord by the way:
I hope you guys understand this example and can tell my why all these IF-commands (there are around 10 more in an official dartbord but this is just an example).
Perhaps it's usefull if i say this is my first 'quest' with QBasic.
Another question:
Is there any way to write all these IF commands as something like this:
When i use two or more IF commands, it uses the last one, i'll give an example. I'm making an simple dartbord by the way:
Code:
0 CLS
05 score = 501
10 INPUT "Please typ a throw in numbers:" throw
20 IF throw = 23 THEN mistake = 1 ELSE mistake = 0
30 IF throw = 29 THEN mistake = 1 ELSE mistake = 0
40 IF throw = 31 THEN mistake = 1 ELSE mistake = 0
50 IF throw > 60 THEN mistake = 1 ELSE mistake = 0
60 IF throw < 0 THEN mistake = 1 ELSE mistake = 0
70 IF mistake = 1 THEN PRINT "This number can't be thrown"
80 IF mistake = 1 THEN GOTO 10
90 total = score - throw
100 score = total
110 PRINT "You still have to throw "; throw; " points"
120 GOTO 10
I hope you guys understand this example and can tell my why all these IF-commands (there are around 10 more in an official dartbord but this is just an example).
Perhaps it's usefull if i say this is my first 'quest' with QBasic.
Another question:
Is there any way to write all these IF commands as something like this:
Code:
IF throw = 23,29,31 THEN mistake = 1 ELSE mistake = 0