1 2 3 4 5 6 7 8 9 10 |
squares=[]
(a[0]..b[0]).each do |x|
(a[1]..b[1]).each do |y|
squares << [x,y]
end
end
squares.delete_if {|l| [a,b].include?(l) }
squares
end
|
Pastie
Support Pastie
or read my
Pastie << self
blog
1 2 3 4 5 6 7 8 9 10 |
squares=[]
(a[0]..b[0]).each do |x|
(a[1]..b[1]).each do |y|
squares << [x,y]
end
end
squares.delete_if {|l| [a,b].include?(l) }
squares
end
|