99 bottles of beer: Difference between revisions

Jakt
(Jakt)
Line 6,167:
2 bottles of beer on the wall, 2 bottles of beer; take one down and pass it around, 1 bottle of beer on the wall
1 bottle of beer on the wall, 1 bottle of beer; take one down and pass it around, 0 bottles of beer on the wall </pre>
 
=={{header|Jakt}}==
<syntaxhighlight lang="jakt">
fn bottle_string(bottle_count: i64) throws -> String => match bottle_count {
0 => "No more bottles"
1 => "1 bottle"
else => format("{} bottles", bottle_count)
}
 
fn main() {
mut bottle_count = 99
while bottle_count > 0 {
println("{} of beer on the wall", bottle_string(bottle_count))
println("{} of beer", bottle_string(bottle_count))
println("Take one down, pass it around")
bottle_count--
println("{} of beer on the wall", bottle_string(bottle_count))
 
if bottle_count > 0 {
println("")
}
}
}
</syntaxhighlight>
 
=={{header|Janet}}==
89

edits