![]() ![]() You should use a linter and/or a static analyzer, preferably one with an auto-correct functionality. Linter, style checker, static analyzer, code formatter Instruction = 'Commands : \n : open cell\n F : flag cell\nq : quit\n' M = int(input('Enter number of mines : ')) H = int(input('Enter height of board: ')) If not self.isValidCell(row, col) or not self.isHidden(row, col): If self.isValidCell(dr, dc) and not self.hasMine(dr, dc): # - 1 ~ 8 : number of adjacent bomb (hidden) If self.isValidCell(row, col) and self.isHidden(row, col): Self.board = for j in range(h)]ĭef allocateMines(self, w, h, numOfMines):ĪllocIndexes = self.getRandomPos(w * h, numOfMines) Could you please help me to check if my code follows good practices for a game-program ? I appreciate any ideas. I did not manage to finish the game in 1 hour at that time, so now I have written it again after the interview. In my coding interview for a company, I got the question to write a Minesweeper game. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |