An extension by Peter Ward (@flowblok) of the BackFlip esoteric programming language.
Here follows the original description by @flowblok from the NCSS 2014 Programming Competition:
Nyan Cat is stuck in an arcade game! You have the feeling that she's trying to get a message to you, but the game is running so slowly it will take days until she completes her message. The game is played on a 2D grid. Nyan Cat enters at the top-left corner, and starts by moving one tile to the right every turn. Some tiles have things displayed on them:
- Arrows (
<
,>
,^
andV
): When Nyan Cat steps on one of these, it changes her direction so she is now moving in the direction the arrow pointed in. However, that arrow then changes direction to point back the way she came from.- Mirrors (
/
and\
): When Nyan Cat hits a mirror, her direction is changed as if she was reflected off it, and the mirror changes to the other type of mirror. For example, if Nyan Cat is moving downwards and hits a/
mirror, she will now be moving to the left, and it will now be a\
mirror.- Stars (
+
): When Nyan Cat hits a star, the game increases her score by one point (it starts at zero).- Clouds (
-
): When Nyan Cat hits a cloud, the game decreases her score by one point.- Checkpoints (
.
): When Nyan Cat hits a cloud [sic], the game prints out her score on a new line of a paper reel on the side of the arcade game.When Nyan Cat goes off the side of the board, the game stops.
You think that Nyan Cat is writing her message by changing the game board so the checkpoints the game prints out spell a message when converted to letters (1 = A, 2 = B, ...).
I have since added three different 'checkpoints' to allow for proper I/O:
,
: Converts the score to its corresponding ASCII character.*
: Converts the score to letters according to the algorithm in the original description.~
: Reads in one character and converts to its corresponding ASCII value.
Version history
This interpreter
v0: initial release
v1: added README and
*
checkpointv2: refactor to allow stepping through the program
v3: added
~
checkpointThe language
v-1: BackFlip
v0: as described for NCSS 2014 ProgComp
v1: added
,
checkpointv2: added
*
checkpointv3: added
~
checkpoint