Skip to content
Snippets Groups Projects
Commit ed7e949a authored by Taddeüs Kroes's avatar Taddeüs Kroes
Browse files

Check one additional pixel for basic blocks to avoid false positive in board 23

parent 1959f5d4
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ BOMB_HUES = [250, 219, 132, 174, 38]
HUE_TOLERANCE = 5
DETECT_BASIC_X = 9
DETECT_BASIC_Y = 15
DETECT_BASIC_Y_CHECK = 17
DETECT_BOMB_X = 22
DETECT_BOMB_Y = 43
DETECT_BOMB_Y_TOLERANCE = 7
......@@ -78,7 +79,10 @@ def detect_block(board, x, y):
if s >= MIN_BASIC_SAT:
for ty, hexpect in enumerate(BASIC_HUES):
if is_hue(h, hexpect):
return ty
h, s, v = board.getpixel((x + DETECT_BASIC_X,
y + DETECT_BASIC_Y_CHECK))
if is_hue(h, hexpect):
return ty
# if no basic block is detected, check another range of pixels for bomb
# contents
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment