Tips for golfing in Emotinomicon

8

2

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.

Erik the Outgolfer

Posted 2016-09-25T15:31:22.970

Reputation: 38 134

Please help popularise Emotinomicon, if you can. As it stands right now, only 2 people use it AFAIK (me and Conor O'Brien). – Erik the Outgolfer – 2016-09-25T15:42:40.287

1While 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. – Conor O'Brien – 2016-09-25T15:45:45.323

@ConorO'Brien I know, but I have alerady posted 4 answers, and might post more. – Erik the Outgolfer – 2016-09-25T15:46:44.793

While that's true, half of them are interpreter bugs that I might fix in the future. – Conor O'Brien – 2016-09-25T15:48:20.147

@ConorO'Brien That's why I've said "right now". Also, there are currently 2 of them. – Erik the Outgolfer – 2016-09-25T15:54:02.610

Why the downvote? – acrolith – 2016-09-25T18:45:07.797

@daHugLenny I don't know, maybe it was a Community Autodownvote, or someone just not liking the simplicity of this post, or even someone who wants to just cost me rep (those guys get their votes removed). – Erik the Outgolfer – 2016-09-26T09:51:33.870

Answers

2

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).

Erik the Outgolfer

Posted 2016-09-25T15:31:22.970

Reputation: 38 134

It's because the string implementation grabs surrogates as well. I'll fix this sometime today, probably. – Conor O'Brien – 2016-09-25T18:28:17.507

1

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.

Erik the Outgolfer

Posted 2016-09-25T15:31:22.970

Reputation: 38 134

I used this for the infinite loop challenge. – Erik the Outgolfer – 2016-09-25T15:47:01.907

1

If you want to output 2 chars or less, do not use ⏪⏬⏩, use the number of s needed.

Erik the Outgolfer

Posted 2016-09-25T15:31:22.970

Reputation: 38 134

1

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.

Erik the Outgolfer

Posted 2016-09-25T15:31:22.970

Reputation: 38 134

1

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⏪⏬⏩

Conor O'Brien

Posted 2016-09-25T15:31:22.970

Reputation: 36 228

1

It seems like I've got the grasp of it... if anyone is wondering, the yes idea originated here.

– Erik the Outgolfer – 2016-09-25T17:14:09.450

0

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 .

Erik the Outgolfer

Posted 2016-09-25T15:31:22.970

Reputation: 38 134

I believe this bug is because JavaScript "123"+1 -> "1231". – Erik the Outgolfer – 2016-11-20T08:52:39.193