Giter Club home page Giter Club logo

a-star-search's Introduction

ABOUT

This is collection of C library data structures and a solution for the fifteen puzzle, using an A* Search.

TODO

  • Library:

    • Better comments, standard format
  • Fifteen Puzzle:

    • Must free memory allocated by the a-star-search

    • Must write unit tests for the solver

INSTALL

  • Install Check, a C testing framework.

  • Download source code.

  • In the a-star-search directory, compile the source files with:

    $ make
    
  • Also in the a-star-search directory, run the tests and ensure they all pass. To run library tests:

    $ make libcheck
    
  • To use the data structures, include the path to the src folder, and link the library object file directory. Here's an example including the linkedlist.h file and linking the lib/src/* folder

    In hello.c:

    /*
     * include the linkedlist header file
     */
    include "../lib/src/linkedlist.h"
    // ...
    

    When compiling:

    $ gcc -o hello hello.c ../lib/src/*.o
    

USAGE

On the command line in the directory with the solver executable, run it with:

  $ ./solver [--help] [--verbose] [--heuristic <hamming | manhattan>] <dim> <pos 1> <pos 2> ... <pos dim * dim>

Running solver with the --help flag will print this screen:

   arguments summary:
         --help                                        Displays this help text.
         --verbose                                     Displays verbose output when solving. This includes a GUI printout and the value of the distance metric.
         --heuristic <hamming | manhattan>             Heuristic metric to use for the A* search. Manhattan is default.
         <dim>                                         Dimension of the square board. If the dimension is n, then we have an n x n board.
         <pos k>                                       Number at position k, where starting from 1, we count left to right, up to down. Put a 0 to mark the empty spot.

SOURCE

a-star-search/
    README.md
    Makefile
    lib/
        src/
            Collection of data structure libraries, including linkedlist, arraylist, priorityqueue, stack, queue, and heap.
        tests/
            Collection of tests for these data structures, using the Check framework
    fifteen-puzzle/
        src/
            Implementation of an A* Search on the fifteen puzzle.
        tests/
            Tests for the fifteen puzzle solver

REFERENCES

README Markdown syntax:

Makefile tutorials:

C Macros:

C iterators:

C auto, static, extern

C arrays:

C function pointers:

Functional programming in C

Common C errors:

C error handling:

C Enums:

Dereferencing Void Pointers:

Printing with color

C Command Line Options

Fifteen Puzzle Parity

a-star-search's People

Contributors

kennyyu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

saadmahboob

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.