ITP1 - Assignment: Tic Tac Toe - return

Adjust file to exit when X or O places 3rd spot or when 9 spots are
filled. "No Winner"

O places 3rd O => exits immediately => You Won!
X places 3rd X => exits after O places next spot => Computer won!
               will exit correctly if X is placed on 9th spot
choices.empty? exits correctly when 9th spot is placed with no winner.
=> "No Winner"
ITP1 - Assignment: Tic Tac Toe

Brandon Conway (TA)

You are REALLY close to having a working solution in the return branch.
The only thing you need to do is break if there is a winner as well as
if the choices array is empty.

change line 52:

break if choices.empty?

to:

break if winner || choices.empty?

This works because you are returning either a string or nil from the
for_the_win method.