Spaces:
Sleeping
Sleeping
correcting the bugs in calculating fen's
Browse files
app.py
CHANGED
@@ -16,8 +16,8 @@ FEN_MAPPING = {
|
|
16 |
"black-pawn": "p", "black-rook": "r", "black-knight": "n", "black-bishop": "b", "black-queen": "q", "black-king": "k",
|
17 |
"white-pawn": "P", "white-rook": "R", "white-knight": "N", "white-bishop": "B", "white-queen": "Q", "white-king": "K"
|
18 |
}
|
19 |
-
GRID_BORDER =
|
20 |
-
GRID_SIZE =
|
21 |
BLOCK_SIZE = GRID_SIZE // 8 # Each block is ~25px
|
22 |
X_LABELS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] # Labels for x-axis (a to h)
|
23 |
Y_LABELS = [8, 7, 6, 5, 4, 3, 2, 1] # Reversed labels for y-axis (8 to 1)
|
@@ -30,8 +30,8 @@ def get_grid_coordinate(pixel_x, pixel_y, perspective):
|
|
30 |
The perspective argument can adjust for white ('w') or black ('b') viewpoint.
|
31 |
"""
|
32 |
# Grid settings
|
33 |
-
border =
|
34 |
-
grid_size =
|
35 |
block_size = grid_size // 8 # Each block is ~25px
|
36 |
|
37 |
x_labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] # Labels for x-axis (a to h)
|
|
|
16 |
"black-pawn": "p", "black-rook": "r", "black-knight": "n", "black-bishop": "b", "black-queen": "q", "black-king": "k",
|
17 |
"white-pawn": "P", "white-rook": "R", "white-knight": "N", "white-bishop": "B", "white-queen": "Q", "white-king": "K"
|
18 |
}
|
19 |
+
GRID_BORDER = 0 # Border size in pixels
|
20 |
+
GRID_SIZE = 224 # Effective grid size (10px to 214px)
|
21 |
BLOCK_SIZE = GRID_SIZE // 8 # Each block is ~25px
|
22 |
X_LABELS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] # Labels for x-axis (a to h)
|
23 |
Y_LABELS = [8, 7, 6, 5, 4, 3, 2, 1] # Reversed labels for y-axis (8 to 1)
|
|
|
30 |
The perspective argument can adjust for white ('w') or black ('b') viewpoint.
|
31 |
"""
|
32 |
# Grid settings
|
33 |
+
border = 0 # 10px border
|
34 |
+
grid_size = 224 # Effective grid size (10px to 214px)
|
35 |
block_size = grid_size // 8 # Each block is ~25px
|
36 |
|
37 |
x_labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] # Labels for x-axis (a to h)
|