Created
October 10, 2012 16:45
-
-
Save hanachin/3866799 to your computer and use it in GitHub Desktop.
ポモドーロたん
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
require 'enumerable/lazy' | |
work = Enumerator.new {|y| loop { y << 25 } } | |
rest = Enumerator.new {|y| loop { 3.times { y << 5 }; y << 15 } } | |
pomodoro = work.lazy.zip(rest) | |
pomodoro.each {|set| | |
work_time, rest_time = set | |
case set | |
when [25, 5] | |
puts "normal" | |
when [25, 15] | |
puts "long" | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment