Skip to content

Play and solve the n-puzzle with A* Search in C++ using SDL2. (42 Silicon Valley)

Notifications You must be signed in to change notification settings

ashih42/n_puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n_puzzle

Play and solve the n-puzzle with A* Search in C++ using SDL2. (42 Silicon Valley)

animation

Prerequisites

You are on macOS with clang++, make, and brew installed.

Installing

./setup.sh

Running

Generate a random puzzle of size n

./npuzzle -s n

Load a puzzle from file

./npuzzle -f file

Controls

Top-level Controls

  • P Print log of moves.
  • R Reset the puzzle.
  • Escape Terminate the program.

Graphics Controls

  • Tab Select next background picture.
  • H Toggle hint on/off.

Player Controls

  • Arrow Keys Slide a tile toward empty position.
  • Backspace Undo last move.

Solver Controls

  • S Solve the puzzle.
  • M Select next search method.
  • K Select next heuristic function.
  • D Print diagnostics about current board state.

About

Play and solve the n-puzzle with A* Search in C++ using SDL2. (42 Silicon Valley)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published