Puzzle game example in java