Coder Social home page Coder Social logo

pgblu / n-puzzle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nixypanda/n-puzzle

0.0 2.0 0.0 650 KB

An app that let's you play the N-Puzzle game (Also has god mode).

Home Page: http://jck-d-rpr.github.io/N-Puzzle

JavaScript 98.64% HTML 0.97% CSS 0.39%

n-puzzle's Introduction

N-Puzzle

The N-puzzle is the generalised version of the 8-puzzle problem) (or the 15-puzzle problem).

The problem: The 8-puzzle problem is a puzzle popularized by Sam Loyd in the 1870s. It is played on a 3-by-3 grid with 8 square blocks labeled 1 through 8 and a blank square. The goal is to rearrange the blocks so that they are in order. The player is permitted to slide blocks horizontally or vertically into the blank square.

##Demo Here take a look at the demo N-Puzzle

Install (Development)

Just copy everything to some folder and then

$ npm install

$ npm run start

and you are done.

The game will launch in the web-browser on localhost:5000. (If some application is using that port just simply change the port in server.js).

Usage

Use the arrow keys to move the tiles and if you can't solve it just hit the solve button the computer will do it for you in the lest number of moves.(Then use space to make a move).

How? you ask It uses the A* search algorithm for doing so.

NOTE: Finding a shortest solution to a slider puzzle is NP-hard, so it's likely your PC might hang on some cases.

n-puzzle's People

Contributors

nixypanda avatar

Watchers

James Cloos avatar Philipp Blume 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.