mirror of
https://github.com/sigmasternchen/html-tictactoe
synced 2025-03-15 03:28:55 +00:00
cleanup: Fix code style issue with get_id method
This commit is contained in:
parent
0e6ef6f3a2
commit
73be2de2ca
3 changed files with 4 additions and 4 deletions
|
@ -30,7 +30,7 @@ def get_taunt(board, outcome):
|
||||||
|
|
||||||
|
|
||||||
def render_board(prefix, old_board, board, outcome):
|
def render_board(prefix, old_board, board, outcome):
|
||||||
with open("output/" + prefix + old_board.getId() + ".html", "w") as file:
|
with open("output/" + prefix + old_board.get_id() + ".html", "w") as file:
|
||||||
file.write(
|
file.write(
|
||||||
template.render(
|
template.render(
|
||||||
board=board,
|
board=board,
|
||||||
|
@ -50,7 +50,7 @@ def generate_options(prefix, old_board, board, outcome):
|
||||||
future = board.apply(move)
|
future = board.apply(move)
|
||||||
response, outcome = calculate_best_move(future)
|
response, outcome = calculate_best_move(future)
|
||||||
|
|
||||||
print(board.getId(), move, response)
|
print(board.get_id(), move, response)
|
||||||
|
|
||||||
generate_options(
|
generate_options(
|
||||||
prefix,
|
prefix,
|
||||||
|
|
|
@ -98,7 +98,7 @@ class Board:
|
||||||
return DRAW
|
return DRAW
|
||||||
|
|
||||||
|
|
||||||
def getId(self):
|
def get_id(self):
|
||||||
id = 0
|
id = 0
|
||||||
for y in range(3):
|
for y in range(3):
|
||||||
for x in range(3):
|
for x in range(3):
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
{%- elif winner != -1 -%}
|
{%- elif winner != -1 -%}
|
||||||
|
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
<a href={{ prefix }}{{ board.apply(Move(x, y)).getId() }}.html>?</a>
|
<a href={{ prefix }}{{ board.apply(Move(x, y)).get_id() }}.html>?</a>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</td>
|
</td>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|
Loading…
Reference in a new issue