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