awitaminosis commited on
Commit
366b3be
·
1 Parent(s): 190a1fc
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -2,7 +2,7 @@ from fastapi import FastAPI
2
  from fastapi.responses import HTMLResponse
3
 
4
  app = FastAPI()
5
- state = [0,0,0,0,0,0,0,0,0]
6
  step = '0'
7
 
8
  @app.get("/")
@@ -52,4 +52,7 @@ def change_step():
52
  @app.get('/turn/{pos}')
53
  def turn(pos):
54
  change_step()
55
- state[int(pos)] = int(not state[int(pos)])
 
 
 
 
2
  from fastapi.responses import HTMLResponse
3
 
4
  app = FastAPI()
5
+ state = [-1,-1,-1,-1,-1,-1,-1,-1,-1]
6
  step = '0'
7
 
8
  @app.get("/")
 
52
  @app.get('/turn/{pos}')
53
  def turn(pos):
54
  change_step()
55
+ if state[int(pos)] == '-1':
56
+ state[int(pos)] = step
57
+ else:
58
+ state[int(pos)] = int(not state[int(pos)])