Execute HQ9+: Difference between revisions

m
→‎{{header|NS-HUBASIC}}: The code no longer uses "X$=(X or Y)$+CHR(13) commands, but still works correctly, and any THEN or GOTO commands are more readable, as one space is now before them for each command, compared to the previous no spaces.
m (→‎{{header|NS-HUBASIC}}: Further optimizations to the code have been made.)
m (→‎{{header|NS-HUBASIC}}: The code no longer uses "X$=(X or Y)$+CHR(13) commands, but still works correctly, and any THEN or GOTO commands are more readable, as one space is now before them for each command, compared to the previous no spaces.)
Line 1,328:
=={{header|NS-HUBASIC}}==
<lang NS-HUBASIC>10 INPUT "INPUT HQ9+ CODE: ",I$
20 JB$=I$+CHR$(13)" BOTTLES OF BEER"
30 BW$=" BOTTLESON OFTHE BEERWALL"
40 W$FOR I="1 ONTO THE WALL"LEN(I$)
50 WC$=W$+CHRMID$(13I$,I,1)
8060 IF C$="H" THEN PRINT "HELLO, WORLD!"
60 FOR I=1 TO LEN(I$)
70 IF C$=MID"Q" THEN PRINT I$(J$,I,1)
10080 A=A+(C$="+")
80 IF C$="H"THEN PRINT "HELLO, WORLD!"
90 IF C$=<>"Q9"THEN PRINTGOTO I$170
100 FOR B=99 TO 1 STEP -1
100 A=A+(C$="+")
110 IFPRINT CB B$<>"9"GOTO 190W$
120 FORPRINT B=99 TO 1 STEP -1B$
130 PRINT B"TAKE B$ONE W$DOWN,"
140 PRINT B"PASS B$IT AROUND"
150 PRINT "TAKEB-1 ONEB$ DOWN,"W$
180160 NEXT
160 PRINT "PASS IT AROUND"
170 PRINT B-1 B$ W$NEXT</lang>
180 NEXT
190 NEXT</lang>
 
=={{header|OCaml}}==
441

edits