From: cassowarii <2374677+cassowarii@users.noreply.github.com> Date: Thu, 9 Jul 2026 21:02:14 +0000 (-0700) Subject: 99 bottles of beer on the wall X-Git-Url: https://git.cassowary.me/gitweb.cgi?a=commitdiff_plain;h=2ef3fa41eeb57880e83f3fbbe8c2481d205bec40;p=sarabande.git 99 bottles of beer on the wall --- diff --git a/sample/99bottlesofbeer.sa b/sample/99bottlesofbeer.sa new file mode 100644 index 0000000..58f1af8 --- /dev/null +++ b/sample/99bottlesofbeer.sa @@ -0,0 +1,38 @@ +def bottles num, otw { + if num == 0 { + print `no more bottles of beer` + } else if num == 1 { + print num + print ` bottle of beer` + } else { + print num + print ` bottles of beer` + } + + if otw { + print ` on the wall` + } + + if num == 0 and otw { + print `!` + } + + println `` +} + +def verse num { + bottles num, true + bottles num, false + println `take one down, pass it around` + bottles num - 1, true + + if num - 1 > 0 { + println `` + } +} + +let counter = 99 +while counter > 0 { + verse counter + counter = counter - 1 +}