Taquin package¶
Documentation for package taquin.
taquin.taquin module¶
Documentation for module taquin.
- class taquin.taquin.Taquin¶
A class that implements the game of Taquin.
- __init__()¶
Constructor for the Taquin class. Initialize the grid, set the intial score and the position of the 0.
- fill_grid()¶
Randomly fills the cases of the grid.
- _get_neighbour()¶
Boundary conditions. If the move goes outside the grid or if a case is already filled, then we can’t move.
- user_input()¶
Allows the user to pick a number to move.
- _move(number=None)¶
First check for boundary (get_neighbour) and move if possible.
- _finish()¶
Compare the configuration of the grid to the expected one at the end of the game.
- gameplay()¶
Run the game.