Skip to content

Commit

Permalink
Removed examples/sudoku
Browse files Browse the repository at this point in the history
  • Loading branch information
yuce committed Oct 20, 2024
1 parent 1bb36a8 commit 4679767
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 226 deletions.
8 changes: 4 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The ones marked with (clp) requires `clp` library of SWI-Prolog.
* (clp) `coins/`
* (clp) `draughts/`
* `hanoi/` : Towers of Hanoi
* (clp) `sendmoremoney/` : if, SEND * MORE = MONEY, what is S, E, N, D, M, O, R, Y?
* (clp) `sudoku/` : Sudoku solver (Prolog code is contributed by Markus Triska)
* `create_term.py` : shows creating a Prolog term
* `register_foreign.py` : shows registering a foreign function
* (clp) `sendmoremoney/` : If, SEND * MORE = MONEY, what is S, E, N, D, M, O, R, Y?
* (clp) `sudoku/` : Moved to `pyswip.examples.sudoku` package
* `create_term.py` : Shows creating a Prolog term
* `register_foreign.py` : Shows registering a foreign function
26 changes: 0 additions & 26 deletions examples/sudoku/sudoku.pl

This file was deleted.

86 changes: 0 additions & 86 deletions examples/sudoku/sudoku.py

This file was deleted.

98 changes: 0 additions & 98 deletions examples/sudoku/sudoku_daily.py

This file was deleted.

24 changes: 12 additions & 12 deletions src/pyswip/examples/sudoku.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ def prolog_source() -> str:

def main():
puzzle = Matrix.from_text("""
. 6 . 1 . 4 . 5 .
. . 8 3 . 5 6 . .
2 . . . . . . . 1
8 . . 4 . 7 . . 6
. . 6 . . . 3 . .
7 . . 9 . 1 . . 4
5 . . . . . . . 2
. . 7 2 . 6 9 . .
. 4 . 5 . 8 . 7 .
""")
print("-- PUZZLE --")
. . 5 . 7 . 2 6 8
. . 4 . . 2 . . .
. . 1 . 9 . . . .
. 8 . . . . 1 . .
. 2 . 9 . . . 7 .
. . 6 . . . . 3 .
. . 2 . 4 . 7 . .
. . . 5 . . 9 . .
9 5 7 . 3 . . . .
""")
print("\n-- PUZZLE --")
puzzle.pretty_print()
print(" -- SOLUTION --")
print("\n-- SOLUTION --")
solution = solve(puzzle)
if solution:
solution.pretty_print()
Expand Down

0 comments on commit 4679767

Please sign in to comment.