Prechádzať zdrojové kódy

Rename parse.py -> detection.py

Taddeus Kroes 5 rokov pred
rodič
commit
1ddd7ae45f
3 zmenil súbory, kde vykonal 7 pridanie a 9 odobranie
  1. 4 7
      analyze.py
  2. 0 0
      detection.py
  3. 3 2
      strategy.py

+ 4 - 7
analyze.py

@@ -2,9 +2,8 @@
 import os
 import numpy as np
 from PIL import Image
-from parse import BLOCK_SIZE, COLUMN_VSHIFT, MIN_COLUMN_VAL, MIN_COLUMN_SAT, \
-                  detect_blocks, detect_exa, detect_held, print_board, \
-                  detect_columns
+from detection import BLOCK_SIZE, COLUMN_VSHIFT, MIN_COLUMN_VAL, \
+                      MIN_COLUMN_SAT, detect_columns
 from strategy import State
 
 
@@ -37,10 +36,8 @@ if __name__ == '__main__':
 
     board = Image.open('screens/board%d.png' % ident).convert('HSV')
     #board.crop((0, 0, board.width, detect_columns(board))).show()
-    blocks = list(detect_blocks(board))
-    exa = detect_exa(board)
-    held = detect_held(board, exa)
-    print_board(blocks, exa, held)
+    state = State.detect(board)
+    state.print()
 
     if extensive:
         make_bitmap(board).save('screens/bitmap%d.png' % ident)

+ 0 - 0
parse.py → detection.py


+ 3 - 2
strategy.py

@@ -2,8 +2,9 @@ import io
 import time
 from contextlib import redirect_stdout
 from itertools import combinations, islice
-from parse import COLUMNS, NOBLOCK, detect_blocks, detect_exa, \
-                  detect_held, print_board, is_basic, is_bomb, bomb_to_basic
+from detection import COLUMNS, NOBLOCK, detect_blocks, detect_exa, \
+                      detect_held, print_board, is_basic, is_bomb, \
+                      bomb_to_basic
 
 
 GRAB, DROP, SWAP, LEFT, RIGHT, SPEED = range(6)