Numbers is an esolang that I made centered around the fact that all commands are numbers (except for one). You can see its page on the Esolangs Wiki here. There is also a python interpreter with more thorough documentation here
Assuming you know how these things work, it is stack-based and has 29 commands split into four categories.
Command | Action |
---|---|
10 | Adds the top two values on the stack |
11 | Subtracts the top two values on the stack |
12 | Multiplies the top two values on the stack |
13 | Divides the top two values on the stack |
14 | Floor divides the top two values on the stack |
15 | Modulos the top two values on the stack |
16 | Increments the top value on the stack |
17 | Decrements the top value on the stack |
18 | Finds the Digital Root of the top value on the stack |
19 | Finds the factorial of the top value on the stack |
Don't be worried by that title, these are just commands that do things to the actual stack or the order of the items in the stack.
Command | Action |
---|---|
20 | Pushes its following value onto the stack. This command also has an alias: *. Prepend it to a number to push it to the the stackāe.x.: *5 which pushes 5 to the stack and is the same as 20 5 but shorter. |
21 | Reverses the stack |
22 | Swaps the top two values on the stack |
23 | Discards the top value on the stack |
24 | Sets the Control Accumulator to the top value on the stack and discards it |
25 | Pushes the Control Accumulator's value onto the stack |
26 | Duplicates the top value on the stack |
27 | Clears the stack |
Command | Action |
---|---|
30 | Outputs the first item on the stack |
31 | Outputs the first item on the stack as an ASCII character |
32 | Outputs the entire stack in the format "1st-item 2nd-item 3rd-item" |
33 | Outputs the entire stack as an ASCII string |
34 | Takes input from the user as an integer and pushes it onto the stack |
35 | Takes input from the user as an ASCII character and pushes its ASCII value onto the stack |
36 | Takes input from the user as an ASCII string and pushes each character's ASCII value onto the stack |
These are commands that control the flow of the program
Command | Action |
---|---|
40 | Only does the next instruction if the Control Accumulator is not 0 |
41 | Only does the next instruction if the Control Accumulator is 0 |
42 | Goto |
44 | Declares functions |
45 | Takes the top value off the stack and treats it as a function, then applies that function to each following number, pushing the results to the stack until finding a closing 45 |
46 | Loads modules |
~ | Halts/Ends the program |
That's OK, these sorts of languages are designed to be confusing and downright weird, but it's for fun. I'll give you some example programs. Just copy-past them into the code-runner below
A program that outputs "Hello, world!":
*20 45 72 101 108 108 111 32 87 111 114 108 100 33 45 33
This one repeats what you say
36 33
And the last one is a simple adder that will ask for two addends and output their sum:
34 34 10 30
Just put your Numbers code in the box, press the button and your output will show below. Enjoy!
Output here...