Created
November 14, 2011 03:33
-
-
Save afeld/1363173 to your computer and use it in GitHub Desktop.
99 bottles using PDD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sing "99 bottles of beer on the wall..." | |
# sing "98 bottles of beer on the wall..." | |
# ...keep counting down... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sing "99 bottles of beer on the wall..." | |
puts "99 bottles of beer on the wall..." | |
# sing "98 bottles of beer on the wall..." | |
puts "98 bottles of beer on the wall..." | |
# ...keep counting down... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# over and over again: | |
# sing "[however many you have] bottles of beer on the wall..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# over and over again: | |
while true do | |
# sing "[however many you have] bottles of beer on the wall..." | |
puts "#{number_of_beers} bottles of beer on the wall..." | |
end # pass it around! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start at 99 | |
number_of_beers = 99 | |
# over and over again: | |
while true do | |
# sing "[however many you have] bottles of beer on the wall..." | |
puts "#{number_of_beers} bottles of beer on the wall..." | |
end # pass it around! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start at 99 | |
number_of_beers = 99 | |
# over and over again: | |
while true do | |
# sing "[however many you have] bottles of beer on the wall..." | |
puts "#{number_of_beers} bottles of beer on the wall..." | |
# take one down! | |
number_of_beers = number_of_beers - 1 | |
end # pass it around! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start at 99 | |
number_of_beers = 99 | |
# over and over again: | |
while number_of_beers > 0 do # but only while we have beers left! | |
# sing "[however many you have] bottles of beer on the wall..." | |
puts "#{number_of_beers} bottles of beer on the wall..." | |
# take one down! | |
number_of_beers = number_of_beers - 1 | |
end # pass it around! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment