QuadnaryLang

From Esolang
Jump to navigation Jump to search

Link to QuadnaryLang interpreter (node.js)
Sorry if this page is dry, I don't know what happened with previous page. First, an explanation on quadnaries. What are they? They function similarity as binary, except instead of the base-2 binary has, it uses base-4.

Stacks Arguments Commands

Numbers
Quadnary (4-base) Binary (2-base) Decimal (10-base)
0 0 0
1 1 1
2 10 2
3 11 3
10 100 4
11 101 5
12 110 6
13 111 7
20 1000 8

Now that we've somewhat explained quadnary, we may now get to this part. Here is a hello world program I've made that is included in the node.js zip folder:

00001231 00001233 00001312;00001201;00001020 00001211 00001230 00001230 00001233 00000230 00000200 00001113 00001233 00001302 00001230 00001210 00000201
00001233 00001311 00001310;00001201;0;00001310 00001233 00001103 00001310 00001302 00001221 00001232 00001213

Breakdown: 00001231 00001233 00001312 (mov is the english name) pushes the quadnary 00001020 00001211 00001230 00001230 00001233 00000230 00000200 00001113 00001233 00001302 00001230 00001210 00000201 (quadnary for Hello, World!) into the one of the 12 stacks, 00001201 (english name is "a")

Stacks

There are 12 stacks you can pick, with a limit for 8 elements each. Here are those stacks:

  • 00001201 (a)
  • 00001201 00001221 00001221 (aii)
  • 00001201 00001221 00001221 00001221 (aiii)
  • 00001201 00001221 00001312 (aiv)
  • 00001202 (b)
  • 00001202 00001221 00001221 (bii)
  • 00001202 00001221 00001221 00001221 (biii)
  • 00001202 00001221 00001312 (biv)
  • 00001203 (c)
  • 00001203 00001221 00001221 (cii)
  • 00001203 00001221 00001221 00001221 (ciii)
  • 00001203 00001221 00001312 (civ)

Also, this means you can only store 96 values at once. Don't spend them all in one place! O:-)

Arguments

Arguments are split by semicolons (;)

Commands

Remember that all arguments must be quadnary! There are only 3 commands. However more commands will be made in the future, right now you can't really do anything with the language because of such limitations

  • 00001231 00001233 00001312 (mov): Pushes a value into a stack
  • 00001233 00001311 00001310 (out): Outputs a value indexed from a stack with the 2nd argument
  • 00001300 00001233 00001300 (pop): Removes a value from a stack using an index (that is the 2nd argument)

Challenges

Coming soon! :-)