Tips for golfing in 1+

What general tips do you have for golfing in 1+? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to 1+ (e.g. "remove unnecessary whitespace" is not an answer).

• This 1+? – Unrelated String Sep 24 at 4:45
• @UnrelatedString Yes. – HighlyRadioactive Sep 24 at 4:45
• Are there actually any answers on this site that use 1+? I'm all for tips pages, but they don't seem necessary if no-one has ever even used the language here. – caird coinheringaahing Sep 24 at 8:17
• @cairdcoinheringaahing Oops. I will do it, then. (Though, because it's a Turing-tarpit, it would be very hard to do simple tasks for usual languages, e. g. ROT13.) – HighlyRadioactive Sep 24 at 9:45
• @TwilightSparkle Why is that hosted on Tumblr??? That's bizarre. Here's a Gist: gist.github.com/DJMcMayhem/c7186ae2890b5c8a54e38ba7a595a7d5 – DJMcMayhem Sep 24 at 14:40

Subroutines can have empty names

(|1+1<) is a valid definition for a subroutine, invoked as ().

• Excellent! I haven't thought of that. – HighlyRadioactive Oct 6 at 1:37

Instead of pushing 0 and compare, do something to other numbers

As 1 is the only literal in 1+ and there's no minus operation, pushing 0 would be expensive (11+1<). A better choice would be change other numbers, so 1 becomes a "relative" 0. For example, if you want to flip a bit, instead of 11+1<<, you can 1+1<.

Instead of exchange and compare, arrange the stack carefully

You don't have to take all input at the beginning of the program. For example, to truthify the input, you can 1.< instead of .1^<.