Permalink
Tệp này chứa văn bản unicode hai chiều có thể được giải thích hoặc biên dịch khác với những gì xuất hiện dưới đây. Để xem xét, hãy mở tệp trong một trình soạn thảo cho thấy các ký tự Unicode ẩn. Tìm hiểu thêm về các ký tự unicode hai chiều
Hậu thế random | |
ClassBoardsPot [đối tượng]: boardSpot[object]: | |
value=0 = 0 | |
selected=False = False | |
mine=False = False | |
def__init __ [tự]: __init__[self]: | |
self.selected=False.selected = False | |
def__str __ [tự]: __str__[self]: | |
trở lại [boardspot.value] str[boardSpot.value] | |
Defismine [tự]: isMine[self]: | |
ifboardspot.value ==-1: boardSpot.value == -1: | |
trở lại True | |
returnFalse False | |
ClassboardClass [đối tượng]: boardClass[object]: | |
def__init __ [self, m_boardsize, m_nummines]: __init__[self, m_boardSize, m_numMines]: | |
self.board = [[boardspot [] foriinrange [m_boardsize]] forjinrange [m_boardsize]]].board = [[boardSpot[] for i in range[m_boardSize]] for j in range[m_boardSize]] | |
self.boardSize=m_boardSize.boardSize = m_boardSize | |
self.numMines=m_numMines.numMines = m_numMines | |
self.selectableSpots=m_boardSize*m_boardSize-m_numMines.selectableSpots = m_boardSize * m_boardSize - m_numMines | |
i=0 = 0 | |
trong khi tôi i =0andi i >= 0 and i = 0 and not self.board[i][y-1].mine: | |
self.board[i][y-1].value+=1.board[i][y-1].value += 1 | |
ify+1 y+1 = 0 and not self.board[x-1][y].mine: | |
self.board[x-1][y].value+=1.board[x-1][y].value += 1 | |
ifx+1 x+1 =0andi i >= 0 and i = 0 and not self.board[i][y-1].selected: | |
trở lại+= str [y].makeMove[i, y-1] | |
ify+1 y+1 = 0 and not self.board[x-1][y].selected: | |
ReturnString+= "|"+str [self.board [x] [y] .value].makeMove[x-1, y] | |
ifx+1 x+1 Chủ Đề |