Racket code for solving chess puzzles