Unbeatable tic-tac-toe game in Ruby