kade-robertson / haystack

a 2d esoteric programming language
MIT License
26 stars 3 forks source link

Basic Documentation #1

Closed zzforrest closed 8 years ago

zzforrest commented 9 years ago

It seems that there's no available documentation on Haystack. It may exist, but the haystack associated with django has overshadowed this. There's also no esolang page for it, and I don't know the language well enough to write that. The best that can be done right now is to figure out the functionality by looking at the interpreter, but it'd be nice for a short list of commands and some examples.

TheThirdOne commented 9 years ago

+1

TheThirdOne commented 9 years ago

Here is a start. If someone could review to ensure clarity and correctness, that'd be great.

Op Desription
+ adds the top two values on the stack
- subtracts the top value from the second to top value
* multiplies the top two values on the stack
/ divides the top value from the second to top value
i take input from user
o output as number
c output as character
d duplicate the top value on the stack
@ move the top value to the back of the stack
[ test the top value is greater than second to top value
] test the top value is less than second to top value
= tests equality between top two values
, discard the top value
; swap the two top values
> moves right
< moves left
v moves down
^ moves up
\ reflects the pointer
/ reflects the pointer
0-9 pushs that number to the stack
? if the top value is truthy, go towards the origin in the axis the pointer wasn't going
" start / stop a string