code for character puzzlers