Implement moving on engine

Thus make all state management the engine's responsibility, and remove
the state maintaining code from frontend!
This commit is contained in:
2021-12-14 21:56:27 +01:00
parent c49bedf0ad
commit a1207f2404
3 changed files with 15 additions and 37 deletions

View File

@@ -60,5 +60,12 @@ def get_moves():
return flask.jsonify(moves)
@app.route("/make_move/", methods=["POST"])
def make_move():
source, target = flask.request.json
state_str = ask_engine(f"make_move,{source},{target}")
return flask.jsonify(parse_state(state_str))
if __name__ == "__main__":
app.run(debug=True, host="127.0.0.1", port=3000)