99 bottles of beer: Difference between revisions

m
used the inline lambdas, and auto property setter
No edit summary
m (used the inline lambdas, and auto property setter)
Line 4,088:
model
int initialBottlesCount, bottlesCount
new by int =bottlesCount
me.initialBottlesCount = bottlesCount
me.bottlesCount = bottlesCount
end
fun subject = text by block do return <|when(me.bottlesCount == 1, "bottle", "bottles") end
fun bottles = text by block do return <|when(me.bottlesCount == 0, "no more", text!me.bottlesCount) end
fun goToWall = void by block
text line = me.bottles() + " " + me.subject() + " of beer on the wall, " +
214

edits