Other tips
- On problems with no input, the stack has
[]
on it, which can be useful. For example start your program with1+
instead of[1]
, or!2
instead of1 2
. - It's okay to have trailing newlines in the output, so
n+
is often a viable alternative to''+
. - code.golf encodes your submission as UTF-8, but GolfScript is not Unicode-aware. Bytes 128-255 are treated as individual identifiers in code. This means
2:µ;¶¶+
prints4
. Remark thatµ
isc2 b5
and¶
isc2 b6
in UTF-8. We are really assigning toc2
, and bothb5
andb6
are ignored (as undefined variables are). []+""+
converts a byte to a string of one character.