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:
pavel committed 2021-12-14 21:56:27 +01:00
1 parent c49bedf0ad
commit a1207f2404
3 files changed
+15 -37

No files matched your search

+7
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)