Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Welcome to DDDD, a terse deque-based language made by andrewthediscorder#9807.
- \ - escape character
- DEQUE MANIPULATION
- N..} - put the text inside N} on the back of the deque
- P..} - same but putting at the front
- o - take away the frontmost element
- O - take away the backmost element
- j - print the frontmost element without removing it
- J - print the backmost element without removing it
- +...} - the text between + and ] is a number n; this rotates the top n elements of the deque clockwise
- -...} - same but for the bottom n elements
- {...}, {-...} - variants with counterclockwise rotation
- : - duplicate the value on the deque top
- $ - duplicate the value on the deque bottom
- r - put what's on top of the deque at the back
- R - put what's on bottom of the deque at the top
- XY...} - map Y to do the sequence of instructions in {Y...}
- w - run the top element of the deque as if it was a DDDD program without popping it
- W - same but the bottom
- y/Y - pop top/bottom 2 stack elements, add an element in their place which is the concatenation of the first (from the top/bottom) with the second
- p
- MATHEMATICS
- If you want to run any of these instructions on elements of the deque that are strings, the elements will be treated as bijective base 94 (if you want to print numbers which have infinitely many nonzero digits after the decimal point they will be printed with n digits where n = number right above/below it; if that number is -1 printing will go on forever char by char)
- mz - zero
- mo - one
- mn - -1
- m+, m-, m/, m*, m^, m% - add, subtract, divide, multiply, exponentiate the second deque item (from the top) with the first, take the second item mod the first (throws an error if either of the first 2 items are noninteger numbers)
- M+, M-... - same, but take the second deque item from the bottom and do the corresponding instruction between it and the first item from the bottom
- ms - square root of the top/bottom element
- mf - floor
- mc - ceil
- m..} - base-what's-in-m..} log of the top/bottom element
- me - e, to [second element from the top/bottom] digits (if above/below an element that is -1 it goes to indefinite digits, so printing it will print the digits of e forever)
- mp - same thing for pi
- mc - check if top/bottom element is negative, add 1 to the top/bottom if true and a 0 otherwise
- mr - same but checking if top/bottom element is prime (returns true for inverses of primes)
- VARIABLE AND INPUT STUFF
- v...} - variable name
- V...} - put the string represented by v+..} on the top of the deque
- V-...} - same thing on the bottom
- i - take from STDIN and put at the top of the deque
- I - take from STDIN and put at the bottom
- CONTROL FLOW
- when c is capitalized replace top with bottom in the definitions
- c..]..} so long as top element is in c..], keep doing what's in ]..}
- c..|..} so long as the top element isn't in c..| keep doing what's in |..}
- c..?..} if the top element is in c..?, do what's in ?..} once
- MISCELLANEOUS
- when n is capitalized replace top with bottom and above with below in the definitions
- nu - put the current unix time on the top of the deque
- nr - put a random number in range [smaller of top 2 numbers, larger of top 2 numbers] to the top of the deque
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement