Aaargh++

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

Aaargh++ (for Aargh plus 2 dimensions) is the language I'm working on right now. It's gonna be 4d. These are the specs:

Goals

  • 4d grid/code/data-array - entire folder with "planes".
  • Stack can be pushed to cell.
  • Stack can be imported from cell.
  • Self modding.
  • Run in native python.
  • Push stored stack to stack, to get list in list.
  • Very heavy on the stack, functions take arguments from the stack, they can't take instructions/data from the grid directly.
  • Basically Aaargh++!
  • Complicated, not limited.
  • Run by native python code.

Specs

  • Planes are 80*80 and form dimension 1 and 2.
  • The grid is an 2d grid of planes, and forms dimension 3 and 4.
  • There is a main file, that's the one you need to execute. It defines the grid, but later on extra planes can be added.

The main file

  • 1d, kinda regular.
  • Planes are loaded with lines like:
0 0 plane1.txt
1 0 plane2.txt
  • There is no need for them to touch, but one can't use code in a plane that isn't touching any plane (unless you load a bridge plane from the program itself). There can be "holes" in the grid, they'll just give you an error if your cursor tries to enter it.

Instructions

Instruction Description
d Set flow direction to d1, increasing ("right") This is the default flow direction.
a Set flow direction to d1, decreasing ("left").
s Set flow direction to d2, increasing ("down").
w Set flow direction to d2, decreasing ("up").
6 Set flow direction to d3, increasing ("right").
4 Set flow direction to d3, decreasing ("left").
2 Set flow direction to d4, increasing ("down").
8 Set flow direction to d4, decreasing ("up").
5 If the first value at stack is 0, invert flow direction (d becomes a, etc.), and jump over the next instriction.
j Store (push) value of the cell above the current cell to stack.
J Store entire stack to cell above.
k Duplicate top value on stack.
K Delete top value off stack.
L Add value of the cell above the current cell to the value on top of the stack.
l Reduce the value on top of the stack by the value of the cell above.
; Fetch (pop) value from top of stack and store to cell above.
: Switch entire stack with cell above.
i Get single char and store it on top of stack.
I Get a set of chars and replace the stack by it.
o Print top value of stack.
O Print entire stack.
p Add plane to the grid. The first 2 values of the stack are the location of it in d3 and d4. The rest of the stack represents the name of the plane.
- Do nothing, and continue to next instruction.

Notes

What cell is above another cell depends on the flow direction. For example, when the flow direction is d1+ (the default), the cell above would be the first cell in the direction d2-. If it's d2-, the cell above is the first cell found in d3+. d4 loops to d1