What general tips do you have for golfing in Starry? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Starry (e.g. "remove comments" is not an answer).
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 communityWhat general tips do you have for golfing in Starry? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Starry (e.g. "remove comments" is not an answer).
Please post one tip per answer.
dup
and add
for large numbersIf you need to produce a big but reasonable number which is a multiple of 2 (and in some cases, even not a multiple), you can push half the number and end with +*
(dup and add) instead of pushing the whole number. The threshold for this is 8 and above.
As mentioned, sometimes you can double, then subtract one (threshold 27), and with multiples of higher 2 powers it can be repeated to gain greater numbers.