diff --git a/README.md b/README.md index fe462ac..8c9259c 100644 --- a/README.md +++ b/README.md @@ -2307,9 +2307,9 @@ async def human_controller(screen, moves): async def model(moves, state, height, width): while state['*'] not in {p for id_, p in state.items() if id_ != '*'}: id_, d = await moves.get() - p = state[id_] + p = state[id_] deltas = {D.n: P(0, -1), D.e: P(1, 0), D.s: P(0, 1), D.w: P(-1, 0)} - new_p = P(p.x + deltas[d].x, p.y + deltas[d].y) + new_p = P(p.x + deltas[d].x, p.y + deltas[d].y) if 0 <= new_p.x < width-1 and 0 <= new_p.y < height: state[id_] = new_p diff --git a/index.html b/index.html index f525b5e..9edea51 100644 --- a/index.html +++ b/index.html @@ -2017,9 +2017,9 @@ D = enum.Enum('D', 'n async def model(moves, state, height, width): while state['*'] not in {p for id_, p in state.items() if id_ != '*'}: id_, d = await moves.get() - p = state[id_] + p = state[id_] deltas = {D.n: P(0, -1), D.e: P(1, 0), D.s: P(0, 1), D.w: P(-1, 0)} - new_p = P(p.x + deltas[d].x, p.y + deltas[d].y) + new_p = P(p.x + deltas[d].x, p.y + deltas[d].y) if 0 <= new_p.x < width-1 and 0 <= new_p.y < height: state[id_] = new_p