Update Algorithmen/Brute Force
@@ -13,12 +13,14 @@ jede Stelle die Rotation einer Zelle festlegt.
|
|||||||
for piece in board:
|
for piece in board:
|
||||||
piece.direction = up
|
piece.direction = up
|
||||||
|
|
||||||
board[0][0].rotate_cw()
|
# Lösen
|
||||||
prev = board[0][0]
|
while not solved:
|
||||||
for piece in board[1:]:
|
board[0][0].rotate_cw()
|
||||||
if prev.direction = up:
|
prev = board[0][0]
|
||||||
piece.rotate_cw()
|
for piece in board[1:]:
|
||||||
else:
|
if prev.direction == up:
|
||||||
break
|
piece.rotate_cw()
|
||||||
|
else:
|
||||||
|
break
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user