Xmaster6y commited on
Commit
e53525f
1 Parent(s): de84014
Files changed (1) hide show
  1. src/play_interface.py +18 -21
src/play_interface.py CHANGED
@@ -47,7 +47,7 @@ def render_board(
47
  current_board: chess.Board,
48
  ):
49
  fen = current_board.fen()
50
- pgn = current_board.variation_san(current_board.move_stack)
51
  image_board = plot_board(current_board)
52
  return fen, pgn, image_board
53
 
@@ -112,7 +112,13 @@ def try_play_move(
112
 
113
 
114
  with gr.Blocks() as interface:
115
- with gr.Row():
 
 
 
 
 
 
116
  current_fen = gr.Textbox(
117
  label="Board FEN",
118
  lines=1,
@@ -124,26 +130,17 @@ with gr.Blocks() as interface:
124
  lines=1,
125
  value="",
126
  )
127
- with gr.Row():
128
- username = gr.Textbox(
129
- label="Username to record on leaderboard (should you win)",
130
- lines=1,
131
- max_lines=1,
132
- value="",
133
- )
134
- with gr.Row():
135
- with gr.Column():
136
- with gr.Row():
137
- move_to_play = gr.Textbox(
138
- label="Move to play (UCI)",
139
- lines=1,
140
- max_lines=1,
141
- value="",
142
- )
143
- play_button = gr.Button("Play")
144
 
145
- with gr.Column():
146
- image_board = gr.Image(label="Board")
147
 
148
  static_inputs = [
149
  username,
 
47
  current_board: chess.Board,
48
  ):
49
  fen = current_board.fen()
50
+ pgn = current_board.root().variation_san(current_board.move_stack)
51
  image_board = plot_board(current_board)
52
  return fen, pgn, image_board
53
 
 
112
 
113
 
114
  with gr.Blocks() as interface:
115
+ with gr.Column():
116
+ username = gr.Textbox(
117
+ label="Username to record on leaderboard (should you win)",
118
+ lines=1,
119
+ max_lines=1,
120
+ value="",
121
+ )
122
  current_fen = gr.Textbox(
123
  label="Board FEN",
124
  lines=1,
 
130
  lines=1,
131
  value="",
132
  )
133
+ with gr.Row():
134
+ move_to_play = gr.Textbox(
135
+ label="Move to play (UCI)",
136
+ lines=1,
137
+ max_lines=1,
138
+ value="",
139
+ )
140
+ play_button = gr.Button("Play")
 
 
 
 
 
 
 
 
 
141
 
142
+ with gr.Column():
143
+ image_board = gr.Image(label="Board")
144
 
145
  static_inputs = [
146
  username,