Skip to main content
Home Forums 68kMLA Apple IIc programming confusion — #11
Post #11 by Dog Cow
Source Forum68kMLA
CategorySoftware
Post DateWed, 25 Feb 2009 - 18:38
Original URLhttps://68kmla.org/bb/threads/apple-iic-programming-confusion.16696/
Post
new

10 home

20 input "What state do you live in?";a

30 if a="Ohio" then goto 50

40 if a<>"Ohio" then goto 10

50 input "Correct! Type 'next' for the next question.";b

60 if b="next" then goto 70

70 home

80 input "What month is this?";c

90 if c="February" then goto 110

100 if c<>"February" then goto 70

110 print "Correct! Thus concludes this program."

120 end
Corrected program:

Code:
10 HOME
20 PRINT "WHAT STATE DO YOU LIVE IN" : INPUT STATE$
30 IF STATE$ = "OHIO" THEN 50 
40 GOTO 10
50 PRINT "CORRECT! TYPE NEXT TO CONTINUE" : INPUT B$
60 IF B$ = "NEXT" THEN PRINT "OK"
70 HOME : PRINT "WHAT MONTH IS IT TODAY" : INPUT MONTH$
80 IF MONTH$ = "FEB" THEN 90 
85 GOTO 60
90 PRINT "CORRECT! THIS IS THE END."
100 END
This has been tested on that simulator and works OK. Note: the syntax "THEN GOTO 100" can be shortened to "THEN 100"

mp.ls