Skip to content

A program that solves the Takuzu problem using A.I. search techniques in Python 3.8 as a project for the Artificial Intelligence course (LEIC-A @ IST 21/22)

License

Notifications You must be signed in to change notification settings

jjasferreira/takuzu-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

takuzu-py

IST Artificial Intelligence course's project (LEIC-A 2021/2022). Made by João Cardoso and José João Ferreira.

Image


How to use

To fill the Takuzu board appropriately, the first line of the input file must have the number N, where N corresponds to the dimension of the N × N board, followed by the board itself, with both 0's and 1's representing a certain value and 2's signaling empty cells.

You can check the files in the tests folder for reference.

python <path_to_takuzu.py> < <path_to_input_file>

Example

python takuzu.py < tests/t_04_007.in

Optionally, if you prefer to save the output to a file, instead of having it being displayed on your terminal.

python takuzu.py < tests/t_04_007.in > tests/t_04_007.result

How to run tests with the test.sh script

./test.sh [flags] <path_to_takuzu.py> <path_to_tests>
  • -d flag shows in the terminal the "diff" of expect output with actual output
  • -c flag removes generated .result files (instead of testing)
  • -h flag (as usual) shows this information

Example

Navigate to your misc folder and type on your terminal:

./test.sh -d ../takuzu.py ../tests

In addition to the tests in this repo, you can find more and their expected results here


Formatting

We made the final report using Obsidian.

In order to keep consistency in this project, we use black as a code formatter for Python files.

Alternatively, for the Markdown ones, we use prettier.

About

A program that solves the Takuzu problem using A.I. search techniques in Python 3.8 as a project for the Artificial Intelligence course (LEIC-A @ IST 21/22)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published