Improve the code to find the next best move.
Check if the current position is a trap.