brute-force

This commit is contained in:
Alfred Baumann
2026-06-08 11:41:48 +02:00
parent 7b7df0f7a8
commit 6de80582d9
3 changed files with 47 additions and 10 deletions

View File

@@ -7,8 +7,6 @@ from random import choice
from src.interface import parse_description
from src.netTypes import Piece, Direction, Coordinate
DEMO_FIELD = parse_description("5x5:c7634887c213e5b8db3e69282")
class Grid:
pieces: list[list[Piece]]
@@ -70,9 +68,13 @@ class Grid:
class NetGame:
_grid: Grid
width: int
height: int
def __init__(self, width: int, height: int) -> None:
self._grid = Grid(width, height)
self.width = width
self.height = height
def get_field(self) -> list[list[Piece]]:
return self._grid.pieces
@@ -85,9 +87,12 @@ class NetGame:
def turn_ccw(self, x: int, y: int) -> None:
self._grid.pieces[x][y].turn_ccw()
def lock(self, x: int, y: int) -> None:
self._grid.pieces[x][y].locked = not self._grid.pieces[x][y].locked
def set_direction(self, x: int, y: int, dir: Direction) -> None:
self._grid.pieces[x][y].direction = dir
def solved(self):
return self._grid.solved()