Giter VIP home page Giter VIP logo

puzzl's Introduction

puzzl

An intelligent version of the sliding-puzzle game for your terminal built in golang

GoDoc

puzzl is an intelligent implementation of the classical sliding-puzzle game.

It's built on top of Golang's concurrency primitives. It uses goroutines and channels for inter process communications to provide real time notification experience in unix terminals.

puzzl comes with an in-built solver which can solve any puzzle configuration faster than Iron Man. โšก

puzzl

I have also written a paper* describing technical details about the game, have a look, in case you want to.

Implementing an intelligent version of the classical sliding-puzzle game for unix terminals using Golang's concurrency primitives

http://arxiv.org/abs/1503.08345

Installation

go get github.com/pravj/puzzl
  • Make sure that the workspace's bin directory is added to your PATH
export PATH=$PATH:$GOPATH/bin

Controls

  • Start the game with the command puzzl.
  • Use Arrow Keys to move the blank tile wherever you want.
  • Press 'h' or 'H' to get any hint for next move.
  • Press ESC key to quit the game.

Features

  • puzzl comes with an in-built solver that powers the automation for the game.
  • puzzl gives you some hope by showing the optimal possible moves to solve any board configuration.
  • puzzl helps you survive the game by giving hints for next move.
  • puzzl tracks all the user moves and accordingly generates score for the game.
  • puzzl shows notifications according to the real time game status.
  • puzzl notifies that whether your last move was right or wrong.

In-built Solver

  • puzzl uses A-star algorithm to solve the game board.
  • puzzl's solver is enough fuel-efficient that it can solve the hardest 3x3 puzzle in 31 moves. Exactly what the ideal solvability condition asks for.

Hints Policy

  • You will get a maximum of 3 hints per game session. No more cheatings. ๐Ÿš”

Scoring Policy

  • puzzl has its own scoring system. It measures the real time game score using two parameters, one is total played game moves (T-score) and another is accumulated correct score (A-score) from all the moves.
  • Whenever a user moves in a correct direction as the solver would have moved, the A-score increases by 1 and decreases by 1 when the user moves in a wrong direction.
  • The score of game at any point of time is calculated by this function. [ score = A-score / T-score ]
  • This way the maximum score of 1 would be possible in only one situation when the user traverse the game's state space in the right direction all the time.

Notification Mechanism

  • puzzl uses a combination of goroutines and channels to deliver real time notifications in the game.
  • Here you can see all the available notifications.

Dependencies


Built with Muzi and Coffee by Pravendra Singh

puzzl's People

Contributors

pravj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

puzzl's Issues

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.