Giter Site home page Giter Site logo

slidingpuzzle's Introduction

SlidingPuzzle

CS420 AI

Puzzle game solved with A* Algorithm

Compile

All the main program is built on standard java library. Only the [utest] package has a dependency on JUnit 4.12, but it is separate from the main program. You can exclude the [utest] package from the source code to compile the main program if you do not have JUnit.

Run

solution.Main class has the main function.

Run the program as: "Main.class heuristic=value output=value input=value size=value".

heuristic : String type, set the heuristic type for A*. "distance" for the sum of the distances of the tiles from their goal positions. "misplace" for the number of misplaced tiles. It's optional, default value will be "distance".

output : String type, show each step of the puzzle solving process in the output file, the value is the name of that file. It's optional, default value will be empty then the step processing will not show out.

input : String type, set the initial state of the puzzle by user's input, type a Integer matrix in a text file. eg, 5 7 4 8 2 6 3 1 0 It's optional, default value will be random Integer matrix generated by the program. make sure your input matrix correspond to the "size" parameter.

size : Integer type, set the size of the puzzle, it = sqrt(puzzle tile number, including empty tile). eg, for 8 puzzle it's sqrt(9) = 3. It's optional, default value is 3.

You can ignore all the optional parameters or some of them. The order of parameter does not matter. eg, "Main.class" "Main.class heuristic=distance" "Main.class heuristic=distance output=step.log" "Main.class output=step.log heuristic=distance input=matrix.input" "Main.class size=4" are all valid format of running parameters.

slidingpuzzle's People

Contributors

gf4t47 avatar

Stargazers

Sadaf Najam avatar

Watchers

 avatar  avatar

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.