On 6/18/07, Todd Benson <caduceass / gmail.com> wrote:
> class Array
>   def up; map {|i| i+1}; end
>   def down; map {|i| i-1}; end
> end
> h = { "a" => [[0,0],[3,4]], "b" => [[1,1],[9,8]], "c" => [[7,6],[4,5]] }
> a = []
> h.each_value {|v| v.each {|coord| a << coord}}

> end
   ^^^ delete the accidental "end" here

> sorted = a.select {|coord| a.include?(coord.up) ||
> a.include?(coord.down) )}.sort
>
> p sorted

sorry 'bout that