@@ -49,5 +49,13 @@ def get_state():
|
||||
return flask.jsonify(state)
|
||||
|
||||
|
||||
@app.route("/get_moves/", methods=["POST"])
|
||||
def get_moves():
|
||||
position_str = flask.request.json
|
||||
moves_str = ask_engine(f"get_moves,{position_str}")
|
||||
moves = [moves_str[i : i + 2] for i in range(0, len(moves_str), 2)]
|
||||
return flask.jsonify(moves)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True, host="127.0.0.1", port=3000)
|
||||
|
||||
Reference in New Issue
Block a user