-
-
Save Hanmac/5419912 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
def draw n=6 | |
to_enum(__method__) unless block_given? | |
draw_all(n).each do |number| | |
break unless number | |
yield number | |
end | |
end | |
def draw_sorted n=6 | |
to_enum(__method__) unless block_given? | |
draw(n).to_a.sort.each { |number| yield number } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment