Task

Implement a    HQ9+    interpreter or compiler.




100 INPUT "HQ9+ : "; I$
110 LET J$ = I$ + CHR$(13)
120 LET H$ = "HELLO, WORLD!"
130 LET B$ = "BOTTLES OF BEER"
140 LET W$ = " ON THE WALL"
150 LET W$ = W$ + CHR$(13)
160 FOR I = 1 TO LEN(I$)
170     LET C$ = MID$(J$, I, 1)
180     IF C$ = "H" THEN PRINT H$
190     IF C$ = "Q" THEN PRINT I$
200     LET A = A + (C$ = "+")
210     IF C$ <> "9" THEN 280
220     FOR B = 99 TO 1 STEP -1
230         PRINT B " " B$ W$ B " " B$
240         PRINT "TAKE ONE DOWN, ";
250         PRINT "PASS IT AROUND"
260         PRINT B - 1 " " B$ W$
270     NEXT B
280 NEXT I