# 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+? Sep 24, 2019 at 4:45
• @UnrelatedString Yes.
– null
Sep 24, 2019 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. Sep 24, 2019 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.)
– null
Sep 24, 2019 at 9:45
• @TwilightSparkle Why is that hosted on Tumblr??? That's bizarre. Here's a Gist: gist.github.com/DJMcMayhem/c7186ae2890b5c8a54e38ba7a595a7d5 Sep 24, 2019 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.
– null
Oct 6, 2019 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<.

Found this while exploiting interpreter features. Apparently Parcly Taxel thinks comments and conditionals are similar because both of them begins with "co". The comment indicators [] are actually instructions because there's no such thing called parsers in 1+.