99 Bottles of Beer/Basic: Difference between revisions

m
Removed duplicate headers which were causing this task to appear twice in each dialect's task stats. Changed garbled header to 'More concurrent'.
m (Syntax highlighting fixup)
m (Removed duplicate headers which were causing this task to appear twice in each dialect's task stats. Changed garbled header to 'More concurrent'.)
Line 5:
[[99 Bottles of Beer]] done in any of the BASIC-languages.
__toc__
=={{header|BASIC}}==
==={{header|QBasic}}===
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
Line 27:
END</syntaxhighlight>
 
==={{header|QuickBASIC}}===
{{works with|QuickBASIC|4.5}}
====Sound====
Line 53:
NEXT x</syntaxhighlight>
 
==={{header|Applesoft BASIC}}===
<syntaxhighlight lang="applesoft basic">H$ = "HELLO, WORLD!":B$ = " BOTTLES OF BEER":N$ = CHR$ (13):W$ = " ON THE WALL" + N$: FOR B = 99 TO 1 STEP - 1: PRINT B;B$W$B" "B$N$"TAKE ONE DOWN, PASS IT AROUND"N$B - 1;B$W$: NEXT </syntaxhighlight>
 
Line 88:
NEXT</syntaxhighlight>
 
==={{header|BASIC256}}===
<syntaxhighlight lang="basic256">#length of querter and eight note in ms
n4 = 1000 * 60 / 80 / 4
Line 125:
 
 
==={{header|BBC BASIC}}===
'''Versión más clásica'''
<syntaxhighlight lang="bbcbasic">
Line 151:
</syntaxhighlight>
 
Alternative version:
 
==={{header|BBC BASIC}}===
 
<syntaxhighlight lang="bbcbasic">
Line 189 ⟶ 188:
</syntaxhighlight>
 
==={{header|Commodore BASIC}}===
 
You may need to remove the semicolon on line 20 when executing on the VIC-20. Also, this looks best on the machines with 40 or more columns.
Line 214 ⟶ 213:
</syntaxhighlight>
 
==={{header|Creative Basic}}===
====window version====
<syntaxhighlight lang="creative basic">DEF Win:WINDOW
Line 474 ⟶ 473:
</syntaxhighlight>
 
==={{header|FBSL}}===
This is a OO version, using FBSL v3.5 Beta
<syntaxhighlight lang="qbasic">#AppType Console
Line 538 ⟶ 537:
</syntaxhighlight>
 
==={{header|FreeBASIC}}===
==== Normal version ====
<syntaxhighlight lang="freebasic">' FB 1.05.0 Win64
Line 573 ⟶ 572:
Sleep</syntaxhighlight>
 
==={{header|FUZE BASIC}}===
<syntaxhighlight lang="qbasic">CLS
DIM s$(1)
Line 587 ⟶ 586:
END</syntaxhighlight>
 
==={{header|Yabasic}}===
<syntaxhighlight lang="yabasic">
b$ = " bottles"
Line 607 ⟶ 606:
 
 
==={{header|GW-BASIC}}===
 
Just a basic loop counting down to one. No big deal. Note that at BOTTLES=1, it is not
Line 620 ⟶ 619:
</syntaxhighlight>
 
==={{header|Integer BASIC}}===
 
IMPORTANT NOTE: Integer BASIC was written (and hand-assembled by Woz himself)
Line 656 ⟶ 655:
RUN</syntaxhighlight>
 
==={{header|Liberty BASIC}}===
<syntaxhighlight lang="lb">For bottles = 99 To 1 Step -1
song$ = song$ + str$(bottles) + " bottle"
Line 671 ⟶ 670:
Print song$</syntaxhighlight>
 
==={{header|Microsoft Small Basic}}===
 
<syntaxhighlight lang="microsoftsmallbasic">
Line 693 ⟶ 692:
</syntaxhighlight>
 
==={{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).
Line 729 ⟶ 728:
</syntaxhighlight>
 
==={{header|MSX Basic}}===
 
<syntaxhighlight lang="msxbasic">
Line 741 ⟶ 740:
</syntaxhighlight>
 
==={{header|OxygenBasic}}===
<syntaxhighlight lang="qbasic">
int x=99
Line 773 ⟶ 772:
</syntaxhighlight>
 
==={{header|PowerBASIC}}===
<syntaxhighlight lang="powerbasic">#COMPILE EXE
#DIM ALL
Line 805 ⟶ 804:
END FUNCTION</syntaxhighlight>
 
==={{header|PureBasic}}===
====Normal version====
<syntaxhighlight lang="purebasic">If OpenConsole()
Line 882 ⟶ 881:
EndIf</syntaxhighlight>
 
==={{header|QB64}}===
''CBTJD'': 2020/03/08
* Manages grammatical support for "1 bottle of beer" and "No more bottles of beer".
Line 897 ⟶ 896:
NEXT</syntaxhighlight>
 
==={{header|REALbasic}}===
Place the following in the "open" event of a console application.
<syntaxhighlight lang="vb">dim bottles as Integer = 99
Line 908 ⟶ 907:
Wend</syntaxhighlight>
 
==={{header|Run BASIC}}===
<syntaxhighlight lang="runbasic">b$ = " bottles"
for bottles = 99 To 1 Step -1
Line 922 ⟶ 921:
next bottles</syntaxhighlight>
 
==={{header|smart BASIC}}===
<syntaxhighlight lang="qbasic">READ b,s$(0),s$(1),a$,b$,c$,d$,e$,f$
g$ = CHR$(10)
Line 944 ⟶ 943:
END</syntaxhighlight>
 
==={{header|Sinclair ZX81 BASIC}}===
Scrolls after each line so doesn't run out of screen space and stop prematurely!
<syntaxhighlight lang="basic">10 FOR N=99 TO 1 STEP -1
Line 958 ⟶ 957:
110 NEXT N</syntaxhighlight>
 
==={{header|TI-83 BASIC}}===
<syntaxhighlight lang="ti83b">PROGRAM:BEER
:For(I,99,1,-1)
Line 975 ⟶ 974:
 
 
==={{header|TI-89 BASIC}}===
<syntaxhighlight lang="ti89b">Prgm
Local i,plural,clockWas,t,k,wait
Line 1,024 ⟶ 1,023:
EndPrgm</syntaxhighlight>
 
==={{header|Tiny BASIC}}===
<syntaxhighlight lang="tiny basic">100 LET N=99
105 GOSUB 120
Line 1,046 ⟶ 1,045:
</syntaxhighlight>
 
==={{header|True BASIC}}===
<syntaxhighlight lang="basic">
! TrueBASIC v6.007
Line 1,074 ⟶ 1,073:
</syntaxhighlight>
 
==={{header|Visual Basic}}===
<syntaxhighlight lang="vb">Sub Main()
Const bottlesofbeer As String = " bottles of beer"
Line 1,109 ⟶ 1,108:
End Sub</syntaxhighlight>
 
==={{header|Visual Basic .NET}}===
'''Platform:''' [[.NET]]
 
Line 1,581 ⟶ 1,580:
...</pre>
 
====<s>More</s>D<s> </s>R<s>con</s>U<s>current</s>NKconcurrent====
<syntaxhighlight lang="vbnet">Module Program
Function Plural(count As Integer) As String
Line 1,667 ⟶ 1,666:
...</pre>
 
==={{header|XBasic}}===
{{trans|Microsoft Small Basic}}
{{works with|Windows XBasic}}
Line 1,699 ⟶ 1,698:
</syntaxhighlight>
 
==={{header|ZX Spectrum Basic}}===
<syntaxhighlight lang="zxbasic">10 DEF FN n$(b)="no more" AND NOT b
20 DEF FN m$(b)=(STR$ b) AND b
Line 1,717 ⟶ 1,716:
160 PRINT "Go to the store and buy some more, 99 bottles of beer on the wall."
</syntaxhighlight>
=={{header|VBA}}==
This version uses tail recursion and inline if-statements,
plus a Static variable to count the number of bottles emptied.
Line 1,770 ⟶ 1,769:
 
</pre>
=={{header|VBScript}}==
===Simple Method===
<syntaxhighlight lang="vb">sub song( numBottles )
9,485

edits