Skip to content

AndreiToroplean/laby-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laby-api

Simple labyrinth manipulations.


Can generate labyrinths like this:

┏━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓     
┃ ←┼→ ┃           ┃                       ┃                 ┃                 ┃                 ┃     
┃     ┃     ╻     ╹     ┏━━━━━┓     ┏━━━━━┛     ╺━━━━━┓     ┗━━━━━╸     ╻     ┗━━━━━━━━━━━╸     ┃     
┃     ┃     ┃           ┃     ┃     ┃                 ┃                 ┃                       ┃     
┃     ╹     ┃     ┏━━━━━┛     ╹     ┃     ╺━━━━━━━━━━━┫     ┏━━━━━╸     ┣━━━━━━━━━━━━━━━━━┓     ┃     
┃           ┃     ┃                 ┃                 ┃     ┃           ┃                 ┃     ┃     
┃     ┏━━━━━┫     ┃     ╺━━━━━┳━━━━━┻━━━━━┳━━━━━╸     ┃     ┃     ╺━━━━━┫     ╺━━━━━┓     ┃     ┃     
┃     ┃     ┃     ┃           ┃           ┃           ┃     ┃           ┃           ┃     ┃     ┃     
┃     ┃     ┃     ┃     ┏━━━━━┛     ╻     ┃     ╺━━━━━┫     ┗━━━━━━━━━━━┫     ╺━━━━━┫     ┃     ┃     
┃     ┃     ┃     ┃     ┃           ┃     ┃           ┃                 ┃           ┃     ┃     ┃     
┃     ┃     ┃     ┗━━━━━┫     ╺━━━━━┫     ┣━━━━━┓     ┗━━━━━━━━━━━┓     ┗━━━━━┓     ┃     ┃     ┃     
┃     ┃     ┃           ┃           ┃     ┃     ┃                 ┃           ┃     ┃     ┃     ┃     
┃     ┃     ┗━━━━━┓     ╹     ┏━━━━━┛     ┃     ┗━━━━━━━━━━━╸     ┃     ╻     ┃     ┃     ┃     ┃     
┃     ┃           ┃           ┃           ┃                       ┃     ┃     ┃     ┃     ┃     ┃     
┃     ┣━━━━━╸     ┗━━━━━┳━━━━━┫     ╺━━━━━┫     ╺━━━━━━━━━━━━━━━━━┫     ┣━━━━━┛     ┃     ┃     ┃     
┃     ┃                 ┃     ┃           ┃                       ┃     ┃           ┃     ┃     ┃     
┃     ╹     ┏━━━━━╸     ┃     ┗━━━━━┓     ┗━━━━━━━━━━━┳━━━━━╸     ┃     ┃     ╺━━━━━┫     ┃     ┃     
┃           ┃           ┃           ┃                 ┃           ┃     ┃           ┃     ┃     ┃     
┣━━━━━━━━━━━┫     ┏━━━━━┻━━━━━┓     ┃     ╺━━━━━┳━━━━━┛     ╺━━━━━┫     ┗━━━━━┓     ┃     ┃     ┃     
┃           ┃     ┃           ┃     ┃           ┃                 ┃           ┃     ┃     ┃     ┃
┃     ╻     ╹     ┃     ╻     ╹     ┗━━━━━┓     ┃     ╺━━━━━━━━━━━┻━━━━━┓     ╹     ┃     ┗━━━━━┫
┃     ┃           ┃     ┃                 ┃     ┃                       ┃           ┃           ┃
┃     ┗━━━━━━━━━━━┛     ┣━━━━━━━━━━━╸     ┃     ┗━━━━━━━━━━━╸     ╻     ┗━━━━━━━━━━━┻━━━━━┓     ┃
┃                       ┃                 ┃                       ┃                       ┃ →┼← ┃
┗━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛

And solve them like so:

┏━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓     
┃ ←┼→ ┃  ┌──→──┐  ┃                       ┃  ┌──→─────→──┐  ┃                 ┃                 ┃
┃  ↓  ┃  ↑  ╻  ↓  ╹     ┏━━━━━┓     ┏━━━━━┛  ↑  ╺━━━━━┓  ↓  ┗━━━━━╸     ╻     ┗━━━━━━━━━━━╸     ┃
┃  │  ┃  │  ┃  │        ┃     ┃     ┃  ┌──→──┘        ┃  │              ┃                       ┃
┃  ↓  ╹  ↑  ┃  ↓  ┏━━━━━┛     ╹     ┃  ↑  ╺━━━━━━━━━━━┫  ↓  ┏━━━━━╸     ┣━━━━━━━━━━━━━━━━━┓     ┃
┃  └──→──┘  ┃  │  ┃                 ┃  └──←─────←──┐  ┃  │  ┃           ┃  ┌──→─────→──┐  ┃     ┃
┃     ┏━━━━━┫  ↓  ┃     ╺━━━━━┳━━━━━┻━━━━━┳━━━━━╸  ↑  ┃  ↓  ┃     ╺━━━━━┫  ↑  ╺━━━━━┓  ↓  ┃     ┃
┃     ┃     ┃  │  ┃           ┃  ┌──→──┐  ┃  ┌──→──┘  ┃  │  ┃           ┃  │        ┃  │  ┃     ┃
┃     ┃     ┃  ↓  ┃     ┏━━━━━┛  ↑  ╻  ↓  ┃  ↑  ╺━━━━━┫  ↓  ┗━━━━━━━━━━━┫  ↑  ╺━━━━━┫  ↓  ┃     ┃
┃     ┃     ┃  │  ┃     ┃  ┌──→──┘  ┃  │  ┃  └──←──┐  ┃  └──→─────→──┐  ┃  └──←──┐  ┃  │  ┃     ┃
┃     ┃     ┃  ↓  ┗━━━━━┫  ↑  ╺━━━━━┫  ↓  ┣━━━━━┓  ↑  ┗━━━━━━━━━━━┓  ↓  ┗━━━━━┓  ↑  ┃  ↓  ┃     ┃
┃     ┃     ┃  └──→──┐  ┃  │        ┃  │  ┃     ┃  └──←─────←──┐  ┃  │        ┃  │  ┃  │  ┃     ┃
┃     ┃     ┗━━━━━┓  ↓  ╹  ↑  ┏━━━━━┛  ↓  ┃     ┗━━━━━━━━━━━╸  ↑  ┃  ↓  ╻     ┃  ↑  ┃  ↓  ┃     ┃
┃     ┃           ┃  └──→──┘  ┃  ┌──←──┘  ┃  ┌──→─────→─────→──┘  ┃  │  ┃     ┃  │  ┃  │  ┃     ┃
┃     ┣━━━━━╸     ┗━━━━━┳━━━━━┫  ↓  ╺━━━━━┫  ↑  ╺━━━━━━━━━━━━━━━━━┫  ↓  ┣━━━━━┛  ↑  ┃  ↓  ┃     ┃
┃     ┃                 ┃     ┃  └──→──┐  ┃  └──←─────←─────←──┐  ┃  │  ┃  ┌──→──┘  ┃  │  ┃     ┃
┃     ╹     ┏━━━━━╸     ┃     ┗━━━━━┓  ↓  ┗━━━━━━━━━━━┳━━━━━╸  ↑  ┃  ↓  ┃  ↑  ╺━━━━━┫  ↓  ┃     ┃
┃           ┃           ┃           ┃  │              ┃  ┌──→──┘  ┃  │  ┃  └──←──┐  ┃  │  ┃     ┃
┣━━━━━━━━━━━┫     ┏━━━━━┻━━━━━┓     ┃  ↓  ╺━━━━━┳━━━━━┛  ↑  ╺━━━━━┫  ↓  ┗━━━━━┓  ↑  ┃  ↓  ┃     ┃
┃           ┃     ┃           ┃     ┃  └──→──┐  ┃  ┌──→──┘        ┃  └──→──┐  ┃  │  ┃  │  ┃     ┃
┃     ╻     ╹     ┃     ╻     ╹     ┗━━━━━┓  ↓  ┃  ↑  ╺━━━━━━━━━━━┻━━━━━┓  ↓  ╹  ↑  ┃  ↓  ┗━━━━━┫
┃     ┃           ┃     ┃                 ┃  │  ┃  └──←─────←──┐        ┃  └──→──┘  ┃  └──→──┐  ┃
┃     ┗━━━━━━━━━━━┛     ┣━━━━━━━━━━━╸     ┃  ↓  ┗━━━━━━━━━━━╸  ↑  ╻     ┗━━━━━━━━━━━┻━━━━━┓  ↓  ┃
┃                       ┃                 ┃  └──→─────→─────→──┘  ┃                       ┃ →┼← ┃
┗━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛

To try it out using Poetry:

  • Clone the repo: git clone https://github.com/AndreiToroplean/laby.git;
  • And run: poetry run generate_and_solve.

About

Simple labyrinth manipulations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages