보드에 임의의 테트리스 모양을 그리는 python 프로그램을 작성하려고합니다. 다음은 내 코드입니다 :무작위 테트리스 모양
def __init__(self, win):
self.board = Board(win, self.BOARD_WIDTH, self.BOARD_HEIGHT)
self.win = win
self.delay = 1000
self.current_shape = self.create_new_shape()
# Draw the current_shape oan the board
self.current_shape = Board.draw_shape(the_shape)
def create_new_shape(self):
''' Return value: type: Shape
Create a random new shape that is centered
at y = 0 and x = int(self.BOARD_WIDTH/2)
return the shape
'''
y = 0
x = int(self.BOARD_WIDTH/2)
self.shapes = [O_shape,
T_shape,
L_shape,
J_shape,
Z_shape,
S_shape,
I_shape]
the_shape = random.choice(self.shapes)
return the_shape
내 문제에있는 "self.current_shape = Board.draw_shape (the_shape) 그것은 the_shape 정의하지만 내가 create_new_shape에 정의 생각하지 않습니다 말한다