Timeline for Minesweeper, python Tkinter, Checking close by tiles
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 5, 2016 at 12:35 | vote | accept | hamp | ||
Apr 2, 2016 at 16:11 | answer | added | 200_success | timeline score: 0 | |
Apr 2, 2016 at 15:42 | history | edited | 200_success | CC BY-SA 3.0 |
deleted 18 characters in body; edited tags; edited title
|
Apr 2, 2016 at 15:25 | answer | added | Georg Friedrich | timeline score: 3 | |
Apr 2, 2016 at 15:20 | comment | added | Simon Forsberg | @GeorgFriedrich Your "answer" has been converted to a comment. If you don't have sufficient reputation to comment, try to get that reputation by posting real questions or answers, not posting an answer that is supposed to be a comment. | |
Apr 2, 2016 at 15:13 | comment | added | zondo |
Yeah, except that count += ... in your first block and def __total... in your second block are indented by four extra spaces. My first comment about not working still applies, though.
|
|
Apr 2, 2016 at 15:10 | comment | added | Georg Friedrich | Something like that? | |
Apr 2, 2016 at 15:06 | comment | added | Georg Friedrich | Yeah thanks. As I said. Not so familiar with python. | |
Apr 2, 2016 at 15:05 | comment | added | zondo |
That won't work. In the original code, count starts out at 0 , so it must have been added to at some point when it was 0 . Yours never will. On a side note, you should use else: , not elif: because elif , like if , expects a condition to follow. It's like else if ...
|
|
Apr 2, 2016 at 14:49 | comment | added | Georg Friedrich |
A question: Do you mean in the line with: # THIS LINE if 0 <= x_index < self.Size and 0 <= y_index < self.__Size: count += self.__buttons[y_index][x_index].mine if not count: self.Size or self.__Size ? Okay. I will assume for now, that you meant __Size . def __total(self, x, y, count, old): if (not count and old) or not old: for x_index in range(-1+x, 2+x): for y_index in range(-1+y, 2+y): if 0 <= x_index < self.Size and 0 <= y_index < self.__Size: if old: self.__push(x_index, y_index) else: count += self.__bu
|
|
Apr 2, 2016 at 14:35 | history | asked | hamp | CC BY-SA 3.0 |