From 8e104667819a25e427dc1f8235f451423d4d1362 Mon Sep 17 00:00:00 2001 From: panki27 Date: Sun, 22 Apr 2018 00:07:18 +0200 Subject: [PATCH] reset flagcount upon restart --- minebash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/minebash b/minebash index 1f8c7ae..eab6726 100755 --- a/minebash +++ b/minebash @@ -275,8 +275,8 @@ def hit(x, y): if i >= 0 and i < width: if j >= 0 and j< height: if playfield[j][i] == UNKNOWN: - #player has not opened this field yet - hit(i,j) + #player has not opened this field yet + hit(i,j) elif playfield[y][x] == MINE: return True @@ -361,10 +361,11 @@ def setup_colors(): clInverted = curses.color_pair(7) def reset(): - global firstmove, playfield, FIELD_GENERATED, FIELDS_CLEARED, CURSOR_POSITION + global firstmove, playfield, FIELD_GENERATED, FIELDS_CLEARED, CURSOR_POSITION, FLAGCOUNT firstmove = False playfield = [[UNKNOWN for x in range(width)] for y in range(height)] FIELD_GENERATED = False + FLAGCOUNT = 0 FIELDS_CLEARED = 0 CURSOR_POSITION = [0,0]