How zinb-il/42-n-puzzle works
This small Python program accepts a puzzle-file path on the command line, parses and validates the file, and constructs an NPuzzle object. The parser reads the file itself and populates the puzzle’s size, grid, and blank-position fields. Although parse_file is annotated to return a puzzle, it does not actually return one, so the command-line flow exposes no parsed result. The sampled code shows no solving or search behavior; map files are inputs, not runtime components.
Main entry points: parsing.py File parser · main.py Command line · n_puzzle.py Puzzle model
Components 5
Other components
- User
- Command line
main.py - Puzzle file
- File parser
parsing.py - Puzzle model
src/n_puzzle.py
Connections 4
- User → Command line: runs with path
main.py - Command line → File parser: calls
main.py - Puzzle file → File parser: reads
parsing.py - File parser → Puzzle model: constructs
parsing.py