8
\$\begingroup\$

What general tips do you have for golfing in Emotinomicon? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Emotinomicon (e.g. "remove comments" is not an answer).

Please post one tip per answer.

\$\endgroup\$
  • \$\begingroup\$ Please help popularise Emotinomicon, if you can. As it stands right now, only 2 people use it AFAIK (me and Conor O'Brien). \$\endgroup\$ – Erik the Outgolfer Sep 25 '16 at 15:42
  • 1
    \$\begingroup\$ While this is an interesting idea, there isn't precisely much room for golfing in this language, except for perhaps changing program flow. Other than that, a lot of the tips that would apply here would apply to other languages with similar code layouts. \$\endgroup\$ – Conor O'Brien Sep 25 '16 at 15:45
  • \$\begingroup\$ @ConorO'Brien I know, but I have alerady posted 4 answers, and might post more. \$\endgroup\$ – Erik the Outgolfer Sep 25 '16 at 15:46
  • \$\begingroup\$ While that's true, half of them are interpreter bugs that I might fix in the future. \$\endgroup\$ – Conor O'Brien Sep 25 '16 at 15:48
  • \$\begingroup\$ @ConorO'Brien That's why I've said "right now". Also, there are currently 2 of them. \$\endgroup\$ – Erik the Outgolfer Sep 25 '16 at 15:54
2
\$\begingroup\$

Should be answers to respective challenges (if they exist). Note that some of these code samples might alerady be answers somewhere else.

If you just want to print undefined, use this 4-byte, 1-char program.

๐Ÿ˜จ

Infinite loop (6 bytes, 2 chars).

โ„นโฉ

Cat (owned by Conor O'Brien) (15 bytes, 5 chars).

โซโชโฌโซโฉ

This program should output the 8 phases of the moon, but it doesn't seem to work (61 bytes, 16 chars).

๐Ÿ˜ญ๐ŸŒ˜๐ŸŒ—๐ŸŒ–๐ŸŒ•๐ŸŒ”๐ŸŒ“๐ŸŒ’๐ŸŒ‘๐Ÿ˜ฒโชโฌ๐Ÿ˜ทโฉ๐Ÿ˜€๐Ÿ˜ฌ

Hypothenuse (27 bytes, 7 chars).

๐Ÿ˜ผ๐Ÿ˜ฃ๐Ÿ˜ผ๐Ÿ˜ฃโž•๐Ÿ˜‹๐Ÿ˜จ
\$\endgroup\$
  • \$\begingroup\$ It's because the string implementation grabs surrogates as well. I'll fix this sometime today, probably. \$\endgroup\$ – Conor O'Brien Sep 25 '16 at 18:28
1
\$\begingroup\$

If you just want a truthy value (or even just a value), without using it, use โ„น. It's 3 bytes, while the others are 4 bytes.

\$\endgroup\$
  • \$\begingroup\$ I used this for the infinite loop challenge. \$\endgroup\$ – Erik the Outgolfer Sep 25 '16 at 15:47
1
\$\begingroup\$

If you want to output 2 chars or less, do not use โชโฌโฉ, use the number of โฌs needed.

\$\endgroup\$
1
\$\begingroup\$

Infinite Looping

If you want to loop a program infinitely, from index n, you can use n๐Ÿ˜ฌ to jump behind the nth character. For example, this 34-byte, 12-char program for yes:

๐Ÿ”Ÿโช๐Ÿ˜ญsey๐Ÿ˜ฒโชโฌโฉ๐Ÿ”Ÿโฉ

Becomes this 32-byte, 11-char program:

๐Ÿ”Ÿ๐Ÿ˜ญsey๐Ÿ˜ฒโชโฌโฉ๐Ÿ˜€๐Ÿ˜ฌ
\$\endgroup\$
  • 1
    \$\begingroup\$ It seems like I've got the grasp of it... if anyone is wondering, the yes idea originated here. \$\endgroup\$ – Erik the Outgolfer Sep 25 '16 at 17:14
1
\$\begingroup\$

Make use of built-ins.

Some cases are:

  • โ‰๏ธโ• -> โ”
  • The numbers 0-10, 100 and i are ๐Ÿ˜€๐Ÿ˜…๐Ÿ˜‰๐Ÿ˜๐Ÿ˜’๐Ÿ˜—๐Ÿ˜œ๐Ÿ˜ก๐Ÿ˜๐Ÿ˜†๐Ÿ”Ÿ๐Ÿ’ฏโ„น, respectively.
  • Multiplication with 2-4 is done with ๐Ÿ˜‡โ˜บ๏ธ๐Ÿ˜, respectively.
  • Division with 2-4 is done with ๐Ÿ˜”๐Ÿ˜™๐Ÿ˜ž, respectively.
  • Exponentiation with 2-4 is done with ๐Ÿ˜ฃ๐Ÿ˜ƒ๐Ÿ˜ˆ, respectively.
  • Rooting:
    • n-Rooting with n being 2-4 is done with ๐Ÿ˜‹๐Ÿ˜๐Ÿ˜•, respectively.
    • For other n, use ๐Ÿ˜…nโž—๐Ÿ˜˜. n is not a literal n, but the power of rooting.
\$\endgroup\$
0
\$\begingroup\$

Because of a bug in the interpreter, if you want to append 1 to a number (e.g. 10 -> 101), use ๐Ÿ˜„. As it is right now, you have to use ๐Ÿ˜…โž• for the true function of ๐Ÿ˜„.

\$\endgroup\$
  • \$\begingroup\$ I believe this bug is because JavaScript "123"+1 -> "1231". \$\endgroup\$ – Erik the Outgolfer Nov 20 '16 at 8:52

Your Answer

By clicking โ€œPost Your Answerโ€, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.