99 Bottles of Beer/Basic: Difference between revisions
Content added Content deleted
(99 Bottles of Beer/Basic en QBasic) |
(→{{header|Minimal BASIC}}: Added) |
||
Line 680: | Line 680: | ||
TextWindow.WriteLine("") |
TextWindow.WriteLine("") |
||
EndFor |
EndFor |
||
</lang> |
|||
==={{header|Minimal BASIC}}=== |
|||
{{trans|BBC BASIC}} |
|||
The cases of 99 bottles and of 1 bottle are extracted from the loop. The variable <code>S$</code> is replaced by litterals, <code>T$</code> is divided into two variables (In Minimal BASIC strings assignable to string variables may contain up to 18 chars). |
|||
<lang gwbasic> |
|||
10 REM 99 Bottles of Beer |
|||
20 LET A$ = " bottle" |
|||
30 LET B$ = " of beer" |
|||
40 LET C$ = " on the wall..." |
|||
50 LET T$ = "Take one down and" |
|||
60 LET U$ = " pass it around," |
|||
70 REM 99 bottles |
|||
80 PRINT 99; A$; "s"; B$; C$; "," |
|||
90 PRINT 99; A$; "s"; B$; "." |
|||
100 PRINT T$; U$ |
|||
110 FOR I = 98 TO 2 STEP -1 |
|||
120 PRINT I; A$; "s"; B$; C$; "." |
|||
130 PRINT |
|||
140 PRINT I; A$; "s"; B$; C$; "," |
|||
150 PRINT I; A$; "s"; B$; "." |
|||
160 PRINT T$; U$ |
|||
170 NEXT I |
|||
180 REM 1 bottle |
|||
190 PRINT 1; A$; B$; C$; "." |
|||
200 PRINT |
|||
210 PRINT 1; A$; B$; C$; "," |
|||
220 PRINT 1; A$; B$; "." |
|||
230 PRINT T$; U$ |
|||
240 PRINT "no more"; A$; "s"; B$; C$; "." |
|||
250 PRINT |
|||
260 PRINT "No more bottles of beer on the wall," |
|||
270 PRINT "no more bottles of beer." |
|||
280 PRINT "Go to the store and buy some more," |
|||
290 PRINT "99 bottles of beer on the wall." |
|||
300 END |
|||
</lang> |
</lang> |
||