Commit ·
366b3be
1
Parent(s): 190a1fc
step
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ from fastapi import FastAPI
|
|
| 2 |
from fastapi.responses import HTMLResponse
|
| 3 |
|
| 4 |
app = FastAPI()
|
| 5 |
-
state = [
|
| 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)] =
|
|
|
|
|
|
|
|
|
|
|
|
| 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)])
|