Advertisement
AndrewThePaster

DDDD

Jul 2nd, 2021 (edited)
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. Welcome to DDDD, a terse deque-based language made by andrewthediscorder#9807.
  2.  
  3. \ - escape character
  4.  
  5. DEQUE MANIPULATION
  6. N..} - put the text inside N} on the back of the deque
  7. P..} - same but putting at the front
  8. o - take away the frontmost element
  9. O - take away the backmost element
  10. j - print the frontmost element without removing it
  11. J - print the backmost element without removing it
  12. +...} - the text between + and ] is a number n; this rotates the top n elements of the deque clockwise
  13. -...} - same but for the bottom n elements
  14. {...}, {-...} - variants with counterclockwise rotation
  15. : - duplicate the value on the deque top
  16. $ - duplicate the value on the deque bottom
  17. r - put what's on top of the deque at the back
  18. R - put what's on bottom of the deque at the top
  19. XY...} - map Y to do the sequence of instructions in {Y...}
  20. w - run the top element of the deque as if it was a DDDD program without popping it
  21. W - same but the bottom
  22. 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
  23. p
  24.  
  25. MATHEMATICS
  26. 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)
  27.  
  28. mz - zero
  29. mo - one
  30. mn - -1
  31. 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)
  32. 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
  33. ms - square root of the top/bottom element
  34. mf - floor
  35. mc - ceil
  36. m..} - base-what's-in-m..} log of the top/bottom element
  37. 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)
  38. mp - same thing for pi
  39. mc - check if top/bottom element is negative, add 1 to the top/bottom if true and a 0 otherwise
  40. mr - same but checking if top/bottom element is prime (returns true for inverses of primes)
  41.  
  42. VARIABLE AND INPUT STUFF
  43. v...} - variable name
  44. V...} - put the string represented by v+..} on the top of the deque
  45. V-...} - same thing on the bottom
  46. i - take from STDIN and put at the top of the deque
  47. I - take from STDIN and put at the bottom
  48.  
  49. CONTROL FLOW
  50. when c is capitalized replace top with bottom in the definitions
  51. c..]..} so long as top element is in c..], keep doing what's in ]..}
  52. c..|..} so long as the top element isn't in c..| keep doing what's in |..}
  53. c..?..} if the top element is in c..?, do what's in ?..} once
  54.  
  55. MISCELLANEOUS
  56. when n is capitalized replace top with bottom and above with below in the definitions
  57. nu - put the current unix time on the top of the deque
  58. 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