Last active
December 14, 2015 12:39
Revisions
-
maxwellE revised this gist
Mar 5, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,5 @@ def evaluate end end end end puts FizzBuzz.new(1,100).evaluate -
maxwellE revised this gist
Mar 5, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,13 +6,13 @@ def initialize(lower_bound,upper_bound) def evaluate (@lower_bound..@upper_bound).map do |x| if (x % 5) == 0 && (x % 3) == 0 "FizzBuzz" elsif (x % 5) == 0 "Buzz" elsif (x % 3) == 0 "Fizz" else x.to_s end end end -
maxwellE created this gist
Mar 5, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ class FizzBuzz def initialize(lower_bound,upper_bound) @lower_bound = lower_bound @upper_bound = upper_bound end def evaluate (@lower_bound..@upper_bound).map do |x| if (x % 5) == 0 && (x % 3) == 0 "FizzBuzz" elsif (x % 5) == 0 "Buzz" elsif (x % 3) == 0 "Fizz" else x.to_s end end end end