99 bottles of beer: Difference between revisions
→{{header|Smalltalk}}
Line 12,448:
This version uses Squeak Smalltalk's String >> format: method. and SequencableCollection >> atPin: method
<syntaxhighlight lang="smalltalk">
|bottles plurals |
Transcript clear.
bottles:='{1} bottle{2} of beer on the wall
{
Take one down, pass it around
{
plurals := #('' 's').
99 to: 1 by: -1 do:[:v |
▲ ifTrue:[Transcript show: (bottles format: {(v asString) . 's' . (v asString) . 's' . ((v -1) asString). 's'}); cr; cr.]
Transcript show: 'hic!'; cr.
</syntaxhighlight>
|