Redwolf is a stack-based esoteric language where each command is the sequence of letters REDWOLF
with some letters repeated. Each repeated letter has a different meaning, depending on how many there are.
It has two datatypes: Lists & Integers.
- 2 - Goto - pop a number from a stack and go to that (0-indexed) line
- 3 - Conditional Goto - pop a value from the stack. If truthy, pop another number and go to that (0-indexed) line.
All of these vectorise.
- 2 - (2) Addition
- 3 - (2) Subtraction
- 4 - (2) Multiplication
- 5 - (2) (Floor) Division
- 6 - (2) Exponentiation
- 7 - (2) Bitwise Or
- 8 - (2) Bitwise And
- 9 - (2) Bitwise Xor
- 2 - Duplicate
- 3 - Pop
- 4 - Swap
- 5 - Rotate stack left
- 6 - Rotate stack right
- 7 - Iterate - push all items onto stack
- 8 - Wrap - push stack
- 9 - Reverse stack
- 2 - (0) Take one input
- 3 - (0) Take the list of inputs
- 4 - (1) Output plain
- 5 - (1) Output as string / char with newline
- 6 - (1) Output as string / char without newline
- 2 - (1) Transpose a list / Factorial a number
- 3 - (1) Sum a list / Create range 1...n
- 4 - (1) Flatten a list / Turn a number into a list of digits
- 5 - (1) Reverse a list / Wrap a number into a list
All vectorise
- 2 - (1) Cosine
- 3 - (1) Sine
- 4 - (1) Natural logarithm
- 5 - (1) Base 10 logarithm
- 6 - (0) Pi
- 7 - (0) E
- 2 - Sort (overloaded to digits)
Numbers are pushed by appending the number encoded in binary with !
and 1
to a command - this will be pushed before the command is executed, so REEEEEEDWOLF1!
squares a number.
A command may contain multiple instructions, for example REEEDDDWOOLF
. This executes all instructions sequentiially i.e. EEE
, then DDD
, and finally OO
.
Appending .
to a command halts the program once that instruction is complete. Halting is unnecessary.