![]() ![]() ![]() Clicking on a “safe” cell (i.e., a cell that does not contain a mine) reveals a number that indicates how many neighboring cells – where a neighbor is a cell that is one square to the left, right, up, down, or diagonal from the given cell – contain a mine. Minesweeper is a puzzle game that consists of a grid of cells, where some of the cells contain hidden “mines.” Clicking on a cell that contains a mine detonates the mine, and causes the user to lose the game. Ask questions via any of CS50’s communities!._cell(row, exit(self, widget, data=None):Īdding the timer, smiley face, and flags in Minesweeper.Due to interaction with several of the course’s projects, and given that this course material was originally from 2020, the latest version of Python you should use in this course is Python 3.10. _start(id, expand=True, fill=True, padding=0)ĭef clicked_handler(self, button, row, col):Ĭell_index = _index(row, col) Print 'Button connect in col '.format(col, row)Ĭell.get_button().connect('clicked', self.clicked_handler, row, col) While mines < (self.rows * ls * self.ratio):įor i, cell in enumerate(_cells()): ![]() Self.attach(cell.get_button(), row, col, 1, 1) # with return _sensitive(False) don't show I clicked all board and all buttons are disable. I try do this in my discoverfunction return _sensitive(False) but after that I don't get any value of my buttons. I want to block button after click with set_sensitive() property. I have a problem with show value of label after click using set_sensitive(False).įirst case I use button.hide()after click and this works good, label value are shows up.īut I don't want to use hide(). I write simple minesweeper game in Python 2.7 with Gtk3. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |