99 bottles of beer: Difference between revisions

original code no longer compiled - replaced with most current example found in 8th's samples folder
(PascalABC.NET)
(original code no longer compiled - replaced with most current example found in 8th's samples folder)
Line 68:
<syntaxhighlight lang="forth">
\ 99 bottles of beer on the wall:
: allout "no more bottles" ;
: just-one "1 bottle" ;
: yeah! dup . " bottles" ;
 
[
: allout "no more bottles" ;,
' allout ,
' just- "one bottle" ,
: yeah! ( dup . " bottles" ;)
' yeah! ,
] var, bottles
 
: .bottles dup 2 n:min bottles @ swap caseof ;
: .beer dup 2 n:min .bottles . " of beer"@ .caseof ;
: .wall .beer " on the wall" . ;
: .take " Take one down and pass it around" . ;
: beers .wall ", " . .beer '; putc cr
n:1- 0 max .take ", " .
.wall '. putc cr drop ;
 
: .beer
' beers 1 99 loop- bye
.bottles . " of beer" . ;
 
: .wall
: .wall .beer " on the wall" . ;
 
: .take
: .take " Take one down and pass it around" . ;
 
: beers
: beers .wall ", " . .beer '; putc cr
n:1- 0 max .take ", " .
.wall '. putc cr drop ;
 
' beers 1 99 loop- bye
bye
</syntaxhighlight>
 
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
62

edits