Created
July 22, 2009 05:24
-
-
Save adamjmurray/151831 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
class Range | |
def * other | |
pairs = [] | |
self.each do |i| | |
other.each do |j| | |
pairs << [i,j] | |
end | |
end | |
return pairs | |
end | |
end | |
((0...6)*(0...4)).each do |x,y| | |
puts "#{x},#{y}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment