Skip to content

Instantly share code, notes, and snippets.

@hatzka-nezumi
Last active December 3, 2015 00:22
Show Gist options
  • Save hatzka-nezumi/eb9891734bb7fbe719ed to your computer and use it in GitHub Desktop.
Save hatzka-nezumi/eb9891734bb7fbe719ed to your computer and use it in GitHub Desktop.
99 bottles of beer in Julia.
# 99 bottles of beer in Julia
# [email protected] - Creative Commons Zero or Unlicense
bottles = 99
s = "s"
while bottles > 0
println("$bottles bottle$s of beer on the wall,")
println("$bottles bottle$s of beer.")
println("Take one down, pass it around,")
bottles -= 1
s = bottles > 1 ? "s" : "" # used to adapt plurals
if bottles == 0
println("No more bottles of beer on the wall.")
else
println("$bottles bottle$s of beer on the wall.")
end
println()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment