Narendra9009 commited on
Commit
51cbff7
·
verified ·
1 Parent(s): 4079f62

correcting the bugs in calculating fen's

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 = 5 # Border size in pixels
20
- GRID_SIZE = 214 # 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,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 = 5 # 10px border
34
- grid_size = 214 # 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)
 
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)