GithubHelp home page GithubHelp logo

multislider's Introduction

MultiSlider

This program solves the puzzle game Multislide from Fancade. The game consists of pieces which can be slided in a direction until they collide with a wall. The goal is to slide all "balls" to all "goals", and there are also switches that opens doors, boxes that balls can push, and stones that can be moved once only. This solver respects all in-game physic laws, like that a ball can push one box but not two, and it manages to solve all levels currently in the game. The solver always finds the solution with the least amount of moves. If the program reports that no solution is found, it means that is has tried all possible moves and couldn't find a solution.

Running

The program is written in Java and runs on Java 16 (or Java 15 with preview features enabled). Compile all sources using javac -d build src/*, enter the directory with cd build and run with java Parser.

Usage

Enter the puzzle, row by row, using these characters:

  • x for wall
  • s for stone
  • b for ball
  • g for goal
  • o for box
  • d for box and goal
  • 1/! for first door/button
  • 2/" for second door/button
  • 3/3 for third door/button

1 and ! were chosen since they occupy the same button, as with 2 and ", and 3 and #. 'd' was added since in one level, there were boxes placed on goals.

Example

Example
This puzzle can be entered as

   xxxx
   x  x
 xxxobx
 x !  x
xxxxobx
xgg1  x
xxxxxxx

...and you end your input with "end". Walls are automatically added to each side, so you could have skipped entering the first and last row, and the first and last column. Then, the program finds the solution and lists all the moves as coordinate pairs, directions and a preview, such as:

#1 (5,2) DOWN -> (5,3)
   xxxx 
   x  x 
 xxx ax 
 x   bx 
xxxx  x 
x     x 
xxxxxxx 

That means that you move the piece at 'a' downwards, and it ends up at 'b'.

Licenses

The code is released under an MIT license. The screenshot is from a minigame in the Fancade app developed by Martin Magni, and the minigame Multislide is made by LukaszM.

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.