资 源 简 介
# -*- coding: utf-8 -*-import simpleguitk as simpleguiimport random# 载入外部图像baymax = simplegui.load_image("http://xmooc.xjau.edu.cn/c4x/XJAU/CS101/asset/baymax.jpg")# 定义常量# 画布的尺寸WIDTH = 600HEIGHT = WIDTH + 100# 图像块的边长IMAGE_SIZE = WIDTH / 3# 图像块坐标列表all_coordinates = [[IMAGE_SIZE*0.5, IMAGE_SIZE*0.5], [IMAGE_SIZE*1.5, IMAGE_SIZE*0.5], [IMAGE_SIZE*2.5, IMAGE_SIZE*0.5], [IMAGE_SIZE*0.5, IMAGE_SIZE*1.5], [IMAGE_SIZE*1.5, IMAGE_SIZE*1.5], [IMAGE_SIZE*2.5, IMAGE_SIZE*1.5], [IMAGE_SIZE*0.5, IMAGE_SIZE*2.5], [IMAGE_SIZE*1.5, IMAGE_SIZE*2.5], None]# 棋盘行列数ROWS = 3COLS = 3# 移动步数steps = 0# 保存所有图像块的列表board = [[None, None, None], [None, None, None