https://rosettacode.org/wiki/99_bottles_of_beer


The smalltalk example does not follow the form.

The lyrics follow this form:

99 bottles of beer on the wall
99 bottles of beer
Take one down, pass it around
98 bottles of beer on the wall
98 bottles of beer on the wall
98 bottles of beer
Take one down, pass it around
97 bottles of beer on the wall


To run it on squeak, I modify it a bit.

Transcript clear.
Smalltalk at: #sr put: 0 ; at: #s put: 0 .
sr := Dictionary new.
sr at: 0 put: ' bottle' ;
   at: 1 put: ' bottles' ;
   at: 2 put: ' of beer' ;
   at: 3 put: ' on the wall' ;
   at: 4 put: 'Take one down, pass it around' .
99 to: 0 by: -1 do: [:v | Transcript show: v .
         ( v == 1 ) ifTrue: [ s := 0. ]
            ifFalse: [ s := 1. ].
Transcript show: (sr at:s) ; show: (sr at:2) ; show: (sr at:3) ; cr.
            Transcript show: v.
Transcript show: (sr at:s) ; show: (sr at:2) ; cr.
    (v ~~ 0) ifTrue: [ Transcript show: (sr at:4) ; cr. ].
   ].


But the output does not match the presented form. 



99 bottles of beer on the wall
99 bottles of beer
Take one down, pass it around
98 bottles of beer on the wall
98 bottles of beer
Take one down, pass it around
97 bottles of beer on the wall
97 bottles of beer
Take one down, pass it around

Specifically, the '98 bottles of beer on the wall should repeat with a CR between the two'

I am thinking replacing the sr Dictionary with a Tuple....to include the second iteration of Bottles of Beer on the wall with the CR between them.
Or, maybe the string replacement thing  we have where we can put in '{1}' paramaters embedded in the string.


Cordially,