Top Level Namespace

Defined Under Namespace

Classes: Board, Game, Human, Minimax, Move, Player

Instance Method Summary collapse

Instance Method Details

#get_player_teamObject



1
2
3
4
5
6
7
8
9
10
11
12
# File 'lib/nick_tac_toe/setup.rb', line 1

def get_player_team
  puts "Choose a team (x or o)"
  input = gets.chomp
  unless input == "x" || input == "X" || input == "o" || input == "O"
    puts "That is neither x nor o!"
    get_player_team
  else
    input = "x" if input == "X"
    input = "o" if input == "O"
    return input
  end
end