c code for puzzles