-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 'solve.py' and implemented a solving system and CLI. Updated RE…
…ADME.md accordingly.
- Loading branch information
1 parent
95db6c5
commit a9bbccd
Showing
6 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
""" | ||
Sudoku Generator | ||
© Atomic Sorcerer 2022 | ||
""" | ||
|
||
from lib.utils import complete_board, print_board | ||
from board.board import Board | ||
|
||
import sys | ||
|
||
|
||
show_build_process = False | ||
|
||
do_highlight = False | ||
|
||
try: | ||
if sys.argv.count("--show_process") > 0: | ||
show_build_process = True | ||
except IndexError: | ||
pass | ||
|
||
try: | ||
if sys.argv.count("--do_highlight") > 0: | ||
do_highlight = True | ||
except IndexError: | ||
pass | ||
|
||
indexes_to_collapse = [] | ||
|
||
|
||
def add_a_coord(): | ||
print("---") | ||
x = int(input("Enter the 'x' coordinate: ")) | ||
y = int(input("Enter the 'y' coordinate: ")) | ||
value = int(input("Enter value to collapse tile to: ")) | ||
coords = (x, y) | ||
|
||
indexes_to_collapse.append((coords, value)) | ||
|
||
add_more = input("Do you want to collapse more tiles (y, N): ") | ||
|
||
if add_more == "y": | ||
add_a_coord() | ||
|
||
|
||
if __name__ == "__main__": | ||
add_a_coord() | ||
|
||
board = Board() | ||
|
||
for i in indexes_to_collapse: | ||
board.collapse_specific_tile(i[0][0], i[0][1], i[1], do_highlight=do_highlight) | ||
|
||
new_board = complete_board(board, show_process=show_build_process) | ||
|
||
print(f"Iteration Amount: {str(new_board[1])}") | ||
print(f"Attempts to create board: {str(new_board[2])}") |