Browse files

first commit

  • Loading branch information...
1 parent 43392a4 commit 90b1f93db563265dff3a2831bd58dff181a54018 @fukayatsu committed May 15, 2012
Showing with 24 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +1 −0 1-1/1-hello.rb
  3. +21 −0 1-1/2-99bottles.rb
View
2 .gitignore
@@ -1,3 +1,5 @@
+*.swp
+
*.gem
*.rbc
.bundle
View
1 1-1/1-hello.rb
@@ -0,0 +1 @@
+puts 'Hello, worlr!'
View
21 1-1/2-99bottles.rb
@@ -0,0 +1,21 @@
+def bottles(num)
+ if (num == 0) then
+ return 'no more bottles'
+ elsif (num == 1) then
+ return '1 bottle'
+ else
+ return "#{num} bottles"
+ end
+end
+
+99.downto 1 do |num|
+ puts """
+#{bottles num} of beer on the wall, #{bottles num} of beer.
+Take one down and pass it around, #{bottles(num-1)} of beer on the wall.
+"""
+end
+
+puts '''
+No more bottles of beer on the wall, no more bottles of beer.
+Go to the store and buy some more, 99 bottoles of beer on the wall.
+'''

0 comments on commit 90b1f93

Please sign in to comment.