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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user