From 803d2ad25e88063189cbf9c6f43bd4f27bf4223b Mon Sep 17 00:00:00 2001 From: panki27 Date: Fri, 20 Apr 2018 08:40:27 +0200 Subject: [PATCH] fixed a bug in field generation which meant that the lines of the first hit square can't be mines --- minebash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minebash b/minebash index dce8d4c..86875e6 100755 --- a/minebash +++ b/minebash @@ -129,8 +129,8 @@ def setup_playfield(w, h, x, y): minesleft = MINECOUNT while minesleft > 0: randx = random.randint(0, width-1) - randy = random.randint(1, height-1) - if playfield[randy][randx] != MINE and randx != x and randy != y: + randy = random.randint(0, height-1) + if playfield[randy][randx] != MINE and ([randx, randy] != CURSOR_POSITION): playfield[randy][randx] = MINE minesleft -= 1 FIELD_GENERATED = True