github.com/Zialus/8-Puzzle-Solver-Swift

8 Puzzle Solver with 7 different algorithms(for now) for a CS Artificial Inteligence Class



Documentation

8-Puzzle-Solver-Swift

Build Status

A swift implementation of 7 different algorithms to solve the 8-puzzle game.

This program was tested on Fedora 23 and Ubuntu 14.04 with swift 2.2

Instructions for Fedora 23

How to install swift (and its dependencies)

curl https://github.com/Zialus/swift-rpm/releases/download/swift-3.0-DEVELOPMENTSNAPSHOT20160301a/swift-3.0-DEVELOPMENTSNAPSHOT20160301a.x86_64.rpm -O -L
sudo dnf install libbsd python libicu clang
sudo rpm -Uvh swift-3.0-DEVELOPMENTSNAPSHOT20160301a.x86_64.rpm

Instructions for Ubuntu 14.04

How to install swift (and its dependencies)

sudo apt-get install clang-3.6
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100

wget -qO- http://dev.iachieved.it/iachievedit.gpg.key | sudo apt-key add -
echo "deb http://iachievedit-repos.s3.amazonaws.com/ trusty main" | sudo tee --append /etc/apt/sources.list
sudo apt-get update
sudo apt-get install swift-2.2

General Instructions

How to compile

To compile just run the makefile with the command:

make

on the terminal

How to run it

./8PuzzleSolver

INPUT

Example:

3 4 2 5 1 7 6 0 8
1 2 3 8 0 4 7 6 5

That input is equivalent to the two following game tables:

3  4  2                1  2  3
5  1  7                8     4
6     8                7  6  5

0 represents the blank position.