9
\$\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\$
7
  • 2
    \$\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\$ Commented Sep 25, 2016 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\$ Commented Sep 25, 2016 at 15:45
  • \$\begingroup\$ @ConorO'Brien I know, but I have alerady posted 4 answers, and might post more. \$\endgroup\$ Commented Sep 25, 2016 at 15:46
  • \$\begingroup\$ While that's true, half of them are interpreter bugs that I might fix in the future. \$\endgroup\$ Commented Sep 25, 2016 at 15:48
  • \$\begingroup\$ @ConorO'Brien That's why I've said "right now". Also, there are currently 2 of them. \$\endgroup\$ Commented Sep 25, 2016 at 15:54

6 Answers 6

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\$
1
  • \$\begingroup\$ It's because the string implementation grabs surrogates as well. I'll fix this sometime today, probably. \$\endgroup\$ Commented Sep 25, 2016 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\$
1
  • \$\begingroup\$ I used this for the infinite loop challenge. \$\endgroup\$ Commented Sep 25, 2016 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
  • 1
    \$\begingroup\$ It seems like I've got the grasp of it... if anyone is wondering, the yes idea originated here. \$\endgroup\$ Commented Sep 25, 2016 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\$
1
  • \$\begingroup\$ I believe this bug is because JavaScript "123"+1 -> "1231". \$\endgroup\$ Commented Nov 20, 2016 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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