Name: FirstMove

Author: David Stevenson

Code:

first_move = nil
matrix = move_matrix
0.upto(2) do |x|
  break if first_move
  0.upto(2) do |y|
    break if first_move
    first_move = [x,y] if matrix[x][y] == ""
  end
end
make_move!(first_move[0], first_move[1])

Edit | Play against X | Play against O | Back