Skip to content

Instantly share code, notes, and snippets.

@tiago
Created September 26, 2016 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiago/b18a4d1f419d9088c7b47583ea523f5b to your computer and use it in GitHub Desktop.
Save tiago/b18a4d1f419d9088c7b47583ea523f5b to your computer and use it in GitHub Desktop.
Pixels Camp Challenge #2 - Final submission (compressed)
c = (a, b, c) => {
for (d = [e = f = 0], g = output_char, m = (a, b, c) => {
for (h = 1, e += c; h += l[e += c] == a ? 1 : l[e] == b ? -1 : 0;);
}, i = {
moo: $ => m(k[0], k[7], -1) | e--,
mOo: $ => f--,
moO: $ => d[++f] |= 0,
mOO: $ => 3 == n || i[k[n]](),
Moo: $ => n ? g(String.fromCharCode(n)) : d[f] = input_char(),
MOo: $ => d[f]--,
MoO: $ => d[f]++,
MOO: $ => n || m(k[7], k[0], 1),
OOO: $ => d[f] = 0,
MMM: $ => b ? (d[f] = b, b = c) : b = n,
OOM: $ => [...n + ""].map(g)
}, k = Object.keys(i), l = a.match(RegExp(k.join `|`, "g")); j = l[e];) i[j](n = d[f]), e++
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment