Encoding and solutions of various puzzles