Commit ·
b00ba63
1
Parent(s): c0ecdf0
pointer
Browse files
app.py
CHANGED
|
@@ -47,6 +47,7 @@ def greet_json():
|
|
| 47 |
char = 'X'
|
| 48 |
elif state[i] == 0:
|
| 49 |
char = '0'
|
|
|
|
| 50 |
if i in [0,3,6]:
|
| 51 |
html_content += '<br><br><br><br>'
|
| 52 |
html_content += '<span class="char"><span onclick="go('+str(i)+')">' + char + '</span></span>'
|
|
@@ -70,11 +71,12 @@ def change_step():
|
|
| 70 |
@app.get('/turn/{pos}')
|
| 71 |
def turn(pos):
|
| 72 |
global state
|
| 73 |
-
|
| 74 |
if state[int(pos)] == '-1':
|
| 75 |
state[int(pos)] = step
|
| 76 |
else:
|
| 77 |
state[int(pos)] = int(not state[int(pos)])
|
|
|
|
| 78 |
|
| 79 |
@app.get('/reset')
|
| 80 |
def reset():
|
|
|
|
| 47 |
char = 'X'
|
| 48 |
elif state[i] == 0:
|
| 49 |
char = '0'
|
| 50 |
+
html_content += 'сейчас ходит: ' + step + '<br><br>'
|
| 51 |
if i in [0,3,6]:
|
| 52 |
html_content += '<br><br><br><br>'
|
| 53 |
html_content += '<span class="char"><span onclick="go('+str(i)+')">' + char + '</span></span>'
|
|
|
|
| 71 |
@app.get('/turn/{pos}')
|
| 72 |
def turn(pos):
|
| 73 |
global state
|
| 74 |
+
|
| 75 |
if state[int(pos)] == '-1':
|
| 76 |
state[int(pos)] = step
|
| 77 |
else:
|
| 78 |
state[int(pos)] = int(not state[int(pos)])
|
| 79 |
+
change_step()
|
| 80 |
|
| 81 |
@app.get('/reset')
|
| 82 |
def reset():
|