Skip to main content

Mice in a maze ContentsSyntaxExample programsImplementationNavigation menu

Brainfuck derivatives2015LanguagesTwo-dimensional languagesConcurrent programmingImplemented











Mice in a maze



From Esolang



Jump to: navigation, search


Mice in a maze is another brainfuck derivative. It was invented in 2015 by an anonymous user. Mice in a maze was inspired by items called cellular automata, especially Conway's game of life and Langton's ant.



Contents



  • 1 Syntax

    • 1.1 Defining a maze


    • 1.2 Mice


    • 1.3 Instructions


    • 1.4 Example maze



  • 2 Example programs

    • 2.1 Hello World!



  • 3 Implementation



Syntax


In Mice in a maze, there is a data tape and pointer as in brainfuck. The user defines a maze and places commands around the maze. The user then puts a mouse - or mice - in the maze. As a mouse runs over a command, the command is executed.


Defining a maze


There are two types of wall that can be used to define a maze. W defines a solid wall. K defines a conditional wall, where the wall does not exist if the cell under the pointer is zero, and exists otherwise. These two symbols define a maze such as the one below:


WWWWWWWWW
W W W
WWW W WWW
W W W
W WWWWW W
W W
WWWWWWWWW

The empty spaces are the passageways that the mice can run along.


Mice


Mice are defined by placing numbers in the maze. 1 is the first mouse, 2 is the second, etc. Each mouse begins pointing upwards. The program progresses in timesteps called generations. Every generation the mouse can either:


  • Move one space forward, if the space ahead is empty.

  • Rotate 90 degrees clockwise, if the space ahead contains an existing wall.

  • Disappear, if the space that it is on contains the instruction E.

The program ends when all of the mice disappear.


Instructions


Instructions are placed inside the maze. An instruction is executed when a mouse is on top of it. If multiple mice are on top of instructions during a generation, the lowest numbered mouse's instruction is executed first, then the next lowest numbered, etc. Here is a list of the instructions:


  • > move pointer right

  • < move pointer left

  • + increment the value of the current cell

  • - decrement the value of the current cell

  • . output the character in the current cell

  • , input a character into the current cell

  • E destroy mouse

  • C forces mouse to rotate clockwise as next move

  • A forces mouse to rotate anticlockwise as next move

The first six instructions are the same as in brainfuck. Loops can be implemented by creating a circle in the maze and using conditional walls.


Example maze


This maze doesn't do anything, it's just an example.


WWWWWWWWW
W1 CWC EW
WWW W WWW
WA CWC AW
W WWWWW W
WA 2 AW
WWWWWWWWW

Example programs


If anybody comes up with any example programs, feel free to post them here.


Hello World!


This Hello World! program from TomPN.


 WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
W>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.EW
WWWWWWWWWWWWKWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
W1++++++++++ >+++++++>++++ W
WWWWWWWWWWWW WWWWWWWWWWWWW+W
W -<<<+++>+++++ W
WWWWWWWWWWWWWWWWW

Implementation


  • Mice in a maze/mice.py An implementation in python by User:Koen.

Retrieved from "https://esolangs.org/w/index.php?title=Mice_in_a_maze&oldid=58069"





Navigation menu






















(window.RLQ=window.RLQ||[]).push(function()mw.config.set("wgPageParseReport":"limitreport":"cputime":"0.004","walltime":"0.003","ppvisitednodes":"value":31,"limit":1000000,"ppgeneratednodes":"value":36,"limit":1000000,"postexpandincludesize":"value":0,"limit":2097152,"templateargumentsize":"value":0,"limit":2097152,"expansiondepth":"value":2,"limit":40,"expensivefunctioncount":"value":0,"limit":100,"timingprofile":["100.00% 0.000 1 -total"],"cachereport":"timestamp":"20181024174422","ttl":86400,"transientcontent":false););(window.RLQ=window.RLQ||[]).push(function()mw.config.set("wgBackendResponseTime":25););

Popular posts from this blog

Sahara Skak | Bilen | Luke uk diar | NawigatsjuunCommonskategorii: SaharaWikivoyage raisfeerer: Sahara26° N, 13° O

The fall designs the understood secretary. Looking glass Science Shock Discovery Hot Everybody Loves Raymond Smile 곳 서비스 성실하다 Defas Kaloolon Definition: To combine or impregnate with sulphur or any of its compounds as to sulphurize caoutchouc in vulcanizing Flame colored Reason Useful Thin Help 갖다 유명하다 낙엽 장례식 Country Iron Definition: A fencer a gladiator one who exhibits his skill in the use of the sword Definition: The American black throated bunting Spiza Americana Nostalgic Needy Method to my madness 시키다 평가되다 전부 소설가 우아하다 Argument Tin Feeling Representative Gym Music Gaur Chicken 일쑤 코치 편 학생증 The harbor values the sugar. Vasagle Yammoe Enstatite Definition: Capable of being limited Road Neighborly Five Refer Built Kangaroo 비비다 Degree Release Bargain Horse 하루 형님 유교 석 동부 괴롭히다 경제력

19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу