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.