Il s’agit d’un outil et d’une bibliothèque pour étudier la logique et de programmation Python. Il comprend deux forfaits, on est Sudoku, et un autre est Matrix. Le Sudoku est un oop approche bibliothèque, tandis que la matrice est une bibliothèque traditionnelle de traitement de la fonction.
Cette bibliothèque et document sont important pour le paquet Soduku, le paquet de Matrix est juste une référence pour un programmeur traditionnel.
Vous pouvez utiliser pip pour installer la bibliothèque
pip install SudokuStudyLib
et vous pouvez cloner le projet de
https://github.com/RobertOfTaiwan/SudokuStudyLib
Lorsque vous a installé, il contiendra deux paquets, sudoku, et de la matrice. Ce qui suit est la structure du fichier:
Méthode de la programmation orientée objet: sudoku, dans le test.py
from sudoku import *
# to solve a sudoku defined in data directory
solve("m18.data")
pass
# to solve a sudoku and just using the methods which level <= 15 and if can't solve, don't use guess method
solve("m3.data", level_limit=15, use_try=False)
pass
# to solve a sudoku with emulator methods and print the steps
solve("m12.data", use_emu=True, print_step=True)
pass
# to solve the world's best difficult sudoku
# by default method
solve("m10.data")
# by computer's try error
try_error(None, file="m10.data")
# by all methods but not using human guessing, it can't solve the sudoku
solve("m10.data", use_emu=True, use_try=False)
# by basic human methods and guess
solve("m10.data", level_limit=10, use_try=True)
solve("m10.data", level_limit=3, use_try=True)
Méthode traditionnelle: matrice, dans le test.py
from matrix import *
# solve it directly
m, n, p = main("m6.data")
# solve it by limit methods, it can't solve the sudoku
m, n, p = main("m3.data", methods=8)
# set the limit methods to the 10, and it can solve the sudoku
m, n, p = main("m3.data", methods=10)
# using the try error's method to solve the best difficult sudoku in the world
m, n, p = TryError("m10.data")