bstraehle commited on
Commit
4cb13ff
·
verified ·
1 Parent(s): fd24688

Update multi_agent.py

Browse files
Files changed (1) hide show
  1. multi_agent.py +2 -5
multi_agent.py CHANGED
@@ -7,9 +7,6 @@ made_move = False
7
  board = chess.Board()
8
  board_svgs = []
9
 
10
- def convert_svg_to_png(svg_file_path: str, png_file_path: str) -> None:
11
- cairosvg.svg2png(url=svg_file_path, write_to=png_file_path)
12
-
13
  def get_legal_moves() -> Annotated[str, "A list of legal moves in UCI format"]:
14
  return "Possible moves are: " + ",".join(
15
  [str(move) for move in board.legal_moves]
@@ -21,12 +18,12 @@ def make_move(move: Annotated[str, "A move in UCI format."]) -> Annotated[str, "
21
  global made_move
22
  made_move = True
23
 
24
- svg = convert_svg_to_png(chess.svg.board(
25
  board,
26
  arrows=[(move.from_square, move.to_square)],
27
  fill={move.from_square: "gray"},
28
  size=250
29
- ))
30
 
31
  piece = board.piece_at(move.to_square)
32
  piece_symbol = piece.unicode_symbol()
 
7
  board = chess.Board()
8
  board_svgs = []
9
 
 
 
 
10
  def get_legal_moves() -> Annotated[str, "A list of legal moves in UCI format"]:
11
  return "Possible moves are: " + ",".join(
12
  [str(move) for move in board.legal_moves]
 
18
  global made_move
19
  made_move = True
20
 
21
+ svg = chess.svg.board(
22
  board,
23
  arrows=[(move.from_square, move.to_square)],
24
  fill={move.from_square: "gray"},
25
  size=250
26
+ )
27
 
28
  piece = board.piece_at(move.to_square)
29
  piece_symbol = piece.unicode_symbol()