Execute HQ9+: Difference between revisions
Content added Content deleted
Childishbeat (talk | contribs) m (→{{header|NS-HUBASIC}}: Further optimizations to the code have been made.) |
Childishbeat (talk | contribs) 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: | Line 1,328: | ||
=={{header|NS-HUBASIC}}== |
=={{header|NS-HUBASIC}}== |
||
<lang NS-HUBASIC>10 INPUT "INPUT HQ9+ CODE: ",I$ |
<lang NS-HUBASIC>10 INPUT "INPUT HQ9+ CODE: ",I$ |
||
20 |
20 B$=" BOTTLES OF BEER" |
||
30 |
30 W$=" ON THE WALL" |
||
40 |
40 FOR I=1 TO LEN(I$) |
||
50 |
50 C$=MID$(I$,I,1) |
||
⚫ | |||
60 FOR I=1 TO LEN(I$) |
|||
70 C$= |
70 IF C$="Q" THEN PRINT I$ |
||
⚫ | |||
⚫ | |||
90 IF C$ |
90 IF C$<>"9" GOTO 170 |
||
100 FOR B=99 TO 1 STEP -1 |
|||
⚫ | |||
110 |
110 PRINT B B$ W$ |
||
120 |
120 PRINT B B$ |
||
130 PRINT |
130 PRINT "TAKE ONE DOWN," |
||
140 PRINT |
140 PRINT "PASS IT AROUND" |
||
150 PRINT |
150 PRINT B-1 B$ W$ |
||
⚫ | |||
160 PRINT "PASS IT AROUND" |
|||
170 |
170 NEXT</lang> |
||
⚫ | |||
190 NEXT</lang> |
|||
=={{header|OCaml}}== |
=={{header|OCaml}}== |