Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added several other versions
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short modulo chains exist for all simple commutative operations (additionaddition, multiplication, XORXOR and even OROR). The benefit of using a multiplication is that no parentheses are required.

It's also interesting to note that we still have enough information when reducing both code points modulo 9:

a=>b=>"XX碧紫紅黯靘黻X綠X硅騮XX熏"[a%9^b%9]

Try it online! (53 bytes)

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short modulo chains exist for all simple commutative operations (addition, multiplication, XOR and even OR). The benefit of using a multiplication is that no parentheses are required.

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short modulo chains exist for all simple commutative operations (addition, multiplication, XOR and even OR). The benefit of using a multiplication is that no parentheses are required.

It's also interesting to note that we still have enough information when reducing both code points modulo 9:

a=>b=>"XX碧紫紅黯靘黻X綠X硅騮XX熏"[a%9^b%9]

Try it online! (53 bytes)

minor update
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short modulo chains exist for all simple commutative operations (XOR, additionaddition, multiplication), butXOR and even OR). The benefit of using a multiplication is that no parentheses are required with multiplication.

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short modulo chains exist for all simple commutative operations (XOR, addition, multiplication), but no parentheses are required with multiplication.

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short modulo chains exist for all simple commutative operations (addition, multiplication, XOR and even OR). The benefit of using a multiplication is that no parentheses are required.

minor clarification
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short formulasmodulo chains exist for all simple commutative operations (XOR, addition, multiplication), but no parentheses are required forwith multiplication.

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short formulas exist for all simple commutative operations (XOR, addition, multiplication), but no parentheses are required for multiplication.

JavaScript (ES6), 50 bytes

Expects two code points as (a)(b).

a=>b=>"紫騮靘熏X綠黻紅硅黯碧"[a*b%25%11]

Try it online!

How?

Short modulo chains exist for all simple commutative operations (XOR, addition, multiplication), but no parentheses are required with multiplication.

added a comment
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
saved 2 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading

AltStyle によって変換されたページ (->オリジナル) /