Memorize idioms
Here are a few "idioms" that do certain things, depending on the nature of the language.
Pseudo-linear code
If dynamic code generation is ever required, it may be of use to use the pseudo-linear code model:
v
\"line 1"
\"line 2"
.
.
\"line N"
Assuming \
and v
mean what they usually do.
Infinite loop
In almost all 2D languages, ><
is an infinite, unbreakable loop. If, for some reason, you need to do this, this is the best way, despite how nice this might look:
>v
^<
In fact, if you make your code a 1-liner, you could just use ^
or v
, as such:
i?vo;
This v
will send the IP to itself, wrapping around. You may still be able to use this approach in any instance where a directional command points to a series of (relative) no-ops.
Quine framework
Usually, languages with a string/quote framework can have a quine like this:
<quote><generate "><output stack><terminate>
For ><>, this would look like:
":1-r>o<#
Except this one exits with an error as termination. It is probably the shortest ><> quine, or, at least, the shortest one that I have found.
Shouldn't this question be on Meta? – Mr Lister – 2017-05-17T12:02:54.760
2There's a related meta question here: what is the size of a 2D program? Covered area? Area of the convex hull? Area of the axis-aligned containing rectangle? All might be better measures than some form of ASCII size. – MSalters – 2017-05-17T12:09:51.383
@MrLister Tips questions are on topic for the main site. If you look you can see that we have a good deal of questions under the tips tag already. – Post Rock Garf Hunter – 2017-05-17T15:59:33.247
@MSalters Just like every other programming language length is measured in bytes. Some language designers allow there 2D languages to be arranged in different manners, like Hexagony or Cubix, and thats up to them. – Post Rock Garf Hunter – 2017-05-17T16:02:22.397