slide puzzle python code