I recently saw this language in a challenge and it's awesome. Does anyone have some tips for code-golfing in it?
Your tips should be at least somewhat specific to MarioLANG.
Please post one tip per answer.
Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It only takes a minute to sign up.
Sign up to join this communityI recently saw this language in a challenge and it's awesome. Does anyone have some tips for code-golfing in it?
Your tips should be at least somewhat specific to MarioLANG.
Please post one tip per answer.
This is a pretty simple tip but many MarioLANG programs end something like this, ending with Mario falling down:
.....
=====
and this can be written instead as this:
....
===.
saving two bytes.
If your program has an elevator near an end like this you can often improve even further. This:
]!......
=#======
<
="
goes to this:
]!.
=#.
.
.
<.
=".
You do have to be careful with the last one though, since the added spaces to get to the final instructions can in many situations be more costly than just writing it largely on one line.
Sometimes, you will need multiple copies of a given input - here is a 27 byte snippet that will do this.
>[!
"=#
- )
( +
( )
!+<
#="
Alternate 39 byte horizontal version:
> [!
"=======#
!-((+)+)<
#======="
Before:
Memory Pointer: ˅
Cell : n 0 0
After:
Memory Pointer: ˅
Cell : 0 n n