Giter VIP home page Giter VIP logo

qe-humbug-puzzle's Introduction

Humbug - Genius Puzzle Solver

Humbug - Genuis Puzzle, is a logical puzzle game, available as an android/iOS app. Here.


This program can be used to solve the levels 1-90 of the game. Pull requests are welcome for more levels :).

Instructions:

  • Download the Humbug Puzzle app.
  • Clone this repository to your device.
  • On terminal, run this command:

Linux/MacOS

bash run.sh <maxMoves> testcases/level<levelNumber>.txt

Windows

.\run.bat <maxMoves> testcases/level<levelNumber>.txt
  • Follow the steps printed in terminal, and proceed to the next level.

Each level should not take more than 15 seconds to solve. In fact, except two levels, most will be solve under 5 seconds.

Encoding the levels

This section details how the levels of the app have been encoded before being processed by code. Future developers can feel free to extend this.

Consider level 10 :

humbug_level_10

The game state is represented as a matrix. The input will be given as a matrix. The matrix elements can belong to the above classes.

Token Description
. No boundary wall, empty space
X Normal block
Y Target block
W Wall
P Spider
G Grasshopper
S Snail
L LadyBug
B Butterfly
H HoneyBee

If the grid is n*m, then the matrix size is (2n+1)*(2m+1). The tiles of game are present in (odd, odd) indices. Rest are to store walls.

Refer the above image of Level 10. The top left of matrix is the west corner of the image grid in game.

The test case files consist of this grid, and the last line contains the number of moves to solve the level as per the original game.

Sample Encoding:
...........
.....Y...Y.
...........
.G.GWSWPWY.
...........
.......X...
...........
.......Y...
.......W...

Test Case Generation (New)

Install the requirements listed in requirements.txt. Run in terminal

pip install -r requirements.txt

Run in terminal

python test-case-generator.py

Output will be saved to level.txt.

Sample Encoding:

test_gen

qe-humbug-puzzle's People

Contributors

kohinoor23 avatar saket003 avatar

Watchers

 avatar

Forkers

saket003

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.