GithubHelp home page GithubHelp logo

longercat's Introduction

LongerCat

This program solves the puzzle game Longcat from Fancade. The game consist of a cat that can be moved in one direction until it collides with either its trail or a wall. The goal is to fully fill the space without the cat getting stuck. 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 walls
  • O or space for empty position
  • S for start, where the cat initially is

Example

Example This puzzle can be entered as

xoooxx
xoxoox
oooxoo
osoxxo
oooooo
xxooxx

...and you end your input with "end". Then, the program finds a solution and prints out the moves like:

DOWN, LEFT, UP, RIGHT, DOWN, RIGHT, ...

Just follow the moves to victory.

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 Longcat is made by him as well.

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.