samples/05_mouse/01_mouse_click/app/main.rb
# Defines all spaces on the board.
Defines all spaces on the board.
Defines all spaces on the board .
def all_spaces
    if !block_given?
      state.space_combinations.map do |x, y|
        [x, y, state.spaces[x][y]] 
      end
    else 
      state.space_combinations.map do |x, y|
        yield x, y, state.spaces[x][y] 
      end
    end
  end
def all_spaces if ! block_given? state . space_combinations . map do | x , y | [ x , y , state . spaces [ x ] [ y ] ] end else state . space_combinations . map do | x , y | yield x , y , state . spaces [ x ] [ y ] end end end
Defines all spaces on the board.
Defines all spaces on the board .
# sets definition of space # if a block is given (block_given? is true) # yield if a block is given