習題:觀察(dfs序)
阿新 • • 發佈:2020-11-28
(https://eyehere.net/2011/python-pygame-novice-professional-index/
https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=0&rsv_idx=1&tn=baidu&wd=python%20%E4%BF%84%E7%BD%97%E6%96%AF%E6%96%B9%E5%9D%97&rsv_pq=bb48dd0c00003b51&rsv_t=ef1aeI1tSDtV2W9ArDcBSrh9FiNeX6dK9cScnMl1uAeZgFETpEMxy6eCnfE&rqlang=cn&rsv_enter=1&rsv_sug3=18&rsv_sug1=20&rsv_sug7=100
)
#coding=utf-8
from tkinter import *
from random import *
import threading
from tkinter.messagebox import showinfo
from tkinter.messagebox import askquestion
import threading
from time import sleep
class BrickGame(object):
#是否開始
start = True;
#是否到達底部
isDown = True;
isPause = False;
#窗體
window = None;
#frame
frame1 = None;
frame2 = None;
#按鈕
btnStart = None;
#繪圖類
canvas = None;
canvas1 = None;
#標題
title = "IT Xiao Ang Zai";
#寬和高
width = 400;
height = 650;
#行和列
rows = 20;
cols = 10;
#下降方塊的執行緒
downThread = None;
#幾種方塊
brick = [
[
[
[0,1,1],
[1,1,0],
[0,0,0]
],
[
[1,0,0],
[1,1,0],
[0,1,0]
],
[
[0,1,1],
[1,1,0],
[0,0,0]
],
[
[1,0,0],
[1,1,0],
[0,1,0]
]
],
[
[
[1,1,1],
[1,0,0],
[0,0,0]
],
[
[0,1,1],
[0,0,1],
[0,0,1]
],
[
[0,0,0],
[0,0,1],
[1,1,1]
],
[
[1,0,0],
[1,0,0],
[1,1,0]
]
],
[
[
[1,1,1],
[0,0,1],
[0,0,0]
],
[
[0,0,1],
[0,0,1],
[0,1,1]
],
[
[0,0,0],
[1,0,0],
[1,1,1]
],
[
[1,1,0],
[1,0,0],
[1,0,0]
]
],
[
[
[0,0,0],
[0,1,1],
[0,1,1]
],
[
[0,0,0],
[0,1,1],
[0,1,1]
],
[
[0,0,0],
[0,1,1],
[0,1,1]
],
[
[0,0,0],
[0,1,1],
[0,1,1]
]
],
[
[
[1,1,1],
[0,1,0],
[0,0,0]
],
[
[0,0,1],
[0,1,1],
[0,0,1]
],
[
[0,0,0],
[0,1,0],
[1,1,1]
],
[
[1,0,0],
[1,1,0],
[1,0,0]
]
],
[
[
[0,1,0],
[0,1,0],
[0,1,0]
],
[
[0,0,0],
[1,1,1],
[0,0,0]
],
[
[0,1,0],
[0,1,0],
[0,1,0]
],
[
[0,0,0],
[1,1,1],
[0,0,0]
]
],
[
[
[1,1,0],
[0,1,1],
[0,0,