@@ -33,7 +33,10 @@ def make_piece(piece_str):
|
||||
def get_state():
|
||||
engine.stdin.write(b"get_state\n")
|
||||
engine.stdin.flush()
|
||||
position_str = engine.stdout.readline().decode("ascii").strip()
|
||||
reply = engine.stdout.readline().decode("ascii").strip()
|
||||
status, position_str = reply.split(",")
|
||||
if status != "ok":
|
||||
flask.abort(400)
|
||||
position = {
|
||||
position_str[i + 2 : i + 4]: make_piece(position_str[i : i + 2])
|
||||
for i in range(0, len(position_str), 4)
|
||||
|
||||
Reference in New Issue
Block a user