所以这是我的代码:
class Board:
def __init__ (self, boardLength, boardHeight, pieces):
self.__boardLength = boardLength
self.__boardHeight = boardHeight
self.__pieces = pieces
self.__snapShots = []
self.__tiles = []
while len(self.__tiles) < (self.__boardHeight*self.__boardLength):
self.__tiles.append(0)
board1 = Board(5, 4,
[u,I_shape(1,'I'),X_shape(3,5,'U'),T_shape(4,5,'U'),L_shape(3,5,'U')]
)
我明白了:
TypeError: __init__() takes exactly 4 arguments (3 given)
我知道 init 需要 4 个论点,但其中一个是 self ,而我给了它另外三个。谁能告诉我我做错了什么?