We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

22 (None1)

From Esolang
Jump to navigation Jump to search

22 is an esolang invented by User:None1.

Naming

It's named because of its 2 keywords: 2 and 22. Its 22 commands are also highly related to 2 and 22.

Memory

It has 2 stacks which contain unbounded signed integers. Popping or reading the stack top of an empty stack results in 0.

Commands

Unless otherwise specified, stack refers to thw working stack, which is one of the 2 stacks initially.

  • 2 2 2 2 2 -> Add top of stack by 2.
  • 2 2 2 2 22 -> Subtract top of stack by 2.
  • 2 2 2 22 2 -> Multiply top of stack by 2.
  • 2 2 2 22 22 -> Floor divide top of stack by 2.
  • 2 2 22 2 2 -> Modulo top of stack by 2.
  • 2 2 22 2 22 -> Add top of stack by 22.
  • 2 2 22 22 2 -> Subtract top of stack by 22.
  • 2 2 22 22 22 -> Multiply top of stack by 22.
  • 2 22 2 2 2 -> Floor divide top of stack by 22.
  • 2 22 2 2 22 -> Modulo top of stack by 22.
  • 2 22 2 22 2 -> Add 2 top stack values.
  • 2 22 2 22 22 -> Pop 2 stack values a and b, push b-a
  • 2 22 22 2 2 -> Multiply 2 top stack values.
  • 2 22 22 2 22 -> Pop 2 stack values a and b, push b/a
  • 2 22 22 22 2 -> Pop 2 stack values a and b, push b mod a
  • 2 22 22 22 22 -> Swap 2 stacks.
  • 22 2 2 2 2 -> Pop a, b. If a is not 2, jump to line b+2 (1-indexed, jumping to a non-existent location halts)
  • 22 2 2 2 22 -> Push 2 into the stack.
  • 22 2 2 22 2 -> Bitwise XOR 2 top stack values.
  • 22 2 2 22 22 -> Bitwise AND 2 top stack values.
  • 22 2 22 2 2 -> Bitwise OR 2 top stack values.
  • 22 2 22 2 22 -> Pop a. If a mod 22 is 2, read an integer and push it. If a mod 22 is 2+2(=4), read a Unicode character and push it. If a mod 22 is 22-2(=20), pop stack top and print as integer. Otherwise, pop stack top and print as Unicode character.

Examples

Untested

Hello, world!

2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 22 22 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 22 22 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 22 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 22 22 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 22 22 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 

Nope. interpreter

2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 22 22 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 22 22 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 
2 2 22 2 22 2 2 22 2 22 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 22 2 22 2 22 

XKCD Random Number

2 2 2 2 2 2 2 2 2 2 22 2 2 2 22 2 2 2 2 22 2 2 2 2 22 22 2 22 2 22

A+B

22 2 2 2 22 22 2 22 2 22 22 2 2 2 22 22 2 22 2 22 2 22 2 22 2 22 2 2 2 22 2 2 2 2 22 2 2 2 2 22 22 2 22 2 22

Computational class

Turing complete. 22 has 2 stacks and many functionalities, so a 2-register Minsky machine is trivial.