On this page, you'll check for a tie game, that is, whether there are no more empty squares but neither player has won.
Snap! has a higher-order function that works similarly to
keep
, but it reports only the first item that's found, so it can be faster. Find first
is equivalent to item (1) of (keep)
.
Find first
is a higher-order function like keep
, map
, and combine
because it takes a function (a predicate) as input.
Click for a hint about using find first
to check for ties.
You can work on this project more in Unit 5 Lab 6: Tic-Tac-Toe with a Computer Player.