You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
518 B
17 lines
518 B
1 year ago
|
import random
|
||
|
from PIL import Image,ImageTk
|
||
|
import math
|
||
|
import random
|
||
|
import time
|
||
|
class Chess:
|
||
|
def __init__(self): # 设计五子棋运行的数据结构
|
||
|
self.ChessData = [[{"Cstate": 0, "Cstep": 0} for j in range(19)] for i in range(19)]
|
||
|
def main(self):
|
||
|
i = random.randint(0, 18)
|
||
|
j = random.randint(0, 18)
|
||
|
for color in range(1, 3):
|
||
|
self.ChessData[i][j]['Cstate'] = color
|
||
|
print(self.ChessData[i][j])
|
||
|
if __name__ == '__main__':
|
||
|
chess=Chess()
|
||
|
chess.main()
|