Advertisement
dzaima

BYTT docs

Aug 4th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. EXPLANATION (or something like it)
  2. ____________________________________________________________________________________________________________________________
  3. idea: You have a stack of things that you can manipulate. When the program reaches the end the stack's last item gets printed but or doesn't if the push command is used anywhere in the code.
  4.  
  5. explatation:
  6.  
  7. When referenced to the stack I mean the dataStack. LINESTACK is the stack with line numbers.
  8. S-1 means the last thing in the stack, S-2 - the previous thing in the stack, ect.
  9. S0 means the first in the stack, S1 means second, ect.
  10. S means new thing in stack
  11. S-(1-x) means from S-1 to S-x inclusive
  12.  
  13.  
  14. A quick reference table of the functions:
  15. add input ask pop popRule copy order push MS1 MS2 stack exit repeat var jump jumpIf
  16. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
  17. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
  18.  
  19.  
  20. so, the functions:
  21. 0000/1. add (adds last 2 things or if 1 is a string then joins).
  22. If there is only 1 thing then it acts like there would be 2 of them.
  23. If there is nothing it acts like an ask number and then cloned.
  24.  
  25. 0001/2. start a string/number input for stack. 3 bytes for the length of the text/int and following x bytes will be added to stack as what they were asked as. Length table:
  26. bin 000 001 010 011 100 101 110 111
  27. equals 0bitStr 2bit NUMV 8bit num 16bit num 16bit num-+ 7bit str 14bit Str next 8 bytes say how many bit string
  28. 16bit num-+ is basically that 0000000000000000 = -65537 and 1111111111111111 = -2.
  29. 8-bit num starts from 2 and skips 10.
  30. 16-bit num starts with 258.
  31. 2bit NUMV:
  32. 00 -> -1
  33. 01 -> 0
  34. 10 -> 1
  35. 11 -> 10
  36.  
  37. 0010/3. ask the runner for input. A single byte toggles wether to get a string(1) or number(0). Pushes to the stack.
  38.  
  39. 0011/4. pop 3bytes:
  40. 000 001 010 011 100 101 110 111
  41. S-1 S-2 S-3 S-4 S-5 S-(1-2) S1 S2
  42.  
  43. 0100/5. Switches wether to pop values when they are used. 4 bytes say to what to apply and 3 next bytes are what to pop. Example: to not pop letterXofY's inputs, do 0100 1001 000
  44. Mathstuff1 = math 1byters
  45. Mathstuff2 = math 2byters
  46.  
  47.  
  48. 0101/6. duplicates something in stack. Takes 2 bytes:
  49. 00 01 10 11
  50. copy S-1 copy S-2 copy S-3 copy S-4
  51. if the value is out of bounds, it'll add num 0 to stack
  52.  
  53. 0110/7. Reorders the stack. Takes 5 bytes:
  54. the 1234 -> xxxx means that the last 4 things in the stack (example: 1, 2, 3, 4) to the x, x1, x2, x3.
  55. 00000 - move S0 to S (123456789 -> 234567891)
  56. 00001 - move S1 to S (123456789 -> 134567892)
  57. 00010 - 1234 -> 1243
  58. 00011 - 1234 -> 1342
  59. 00100 - 1234 -> 1324
  60. 00101 - 1234 -> 1432
  61. 00110 - 1234 -> 1423
  62.  
  63. 00111 - 1234 -> 2431
  64. 01000 - 1234 -> 3421
  65. 01001 - 1234 -> 3241
  66. 01010 - 1234 -> 4321
  67. 01011 - 1234 -> 4231
  68. 01100 - 1234 -> 2341
  69.  
  70. 01101 - 1234 -> 2413
  71. 01110 - 1234 -> 3412
  72. 01111 - 1234 -> 3214
  73. 10000 - 1234 -> 4312
  74. 10001 - 1234 -> 4213
  75. 10010 - 1234 -> 2314
  76.  
  77. 10011 - 1234 -> 2143
  78. 10100 - 1234 -> 3142
  79. 10101 - 1234 -> 3124
  80. 10110 - 1234 -> 4132
  81. 10111 - 1234 -> 4123
  82. 11000 - 1234 -> 2134
  83.  
  84. 11001 - 1234 -> S-5 to front
  85. 11010 - 1234 -> S-6 to front
  86. 11011 - 1234 -> S-7 to front
  87. 11100 - 1234 -> S-8 to front
  88. 11101 - 1234 -> S-9 to front
  89. 11110 - 1234 -> S-10 to front
  90. 11111 - 1234 -> S-11 to front
  91.  
  92.  
  93. 0111/8. pushes S-1 things from the stack to CONSOLE joined with " ". If S-1 is a string then use that as the joiner and push S-2 things.
  94.  
  95. MATH STUFF: the number after the bytes is the POP rule it uses (only for ones with single input)
  96.  
  97. 1000/9. math stuff 1: takes the last 0, 1 or 2 things in the stack and does the appropriate thing (default: 1-0, 2-1, 3-1)
  98. 3 bytes:
  99. 000 2 - round (or if S-1 is str then swapcase)
  100. 001 - multiply (or if one is string, != )
  101. 010 - letter S-1 of S-2
  102. 011 2 - abs (or if S-1 is str, reverse)
  103. 100 1 - sqrt (or if string, sqrt rounded up of lenght)
  104. 101 1 - sin (or if S-1 is string, takes last byte off of string & pushes the last char)
  105. 110 1 - length of S-1 string/num
  106. 111 3 - convert S-1 string to num/vice versa
  107.  
  108.  
  109. 1001/10. math stuff 2:
  110. 4 bytes:
  111. 0000 1 - cos (or if S-1 is string, takes 1st byte off of string & pushes the 1st char)
  112. 0001 - random from S-1 to S-2 (or if any is string, pick random either S-1 or S-2)
  113. 0010 - replace S-2 of S-3 with S-1
  114. 0011 2 - << (bitshiftleft) / divide by 2 and floor
  115. 0100 2 - >> (bitshiftright) / multiply by 2
  116. 0101 1 - asin
  117. 0110 - PI (adds value of PI to the stack (800 decimal places so math won't be able to utilize the full potentional of it but if converted to string you could do stuff with it))
  118. 0111 1 - convert string to num or back (may have problems with space as the 1st char)
  119. 1000 1 - sign (-1 if <0, 0 if =0, 1 if >0)
  120. 1001 - < (0 or 1 out) num
  121. 1010 - = (0 or 1 out) num
  122. 1011 - > (0 or 1 out) num
  123. 1100 - divide
  124. 1101 2 - floor (or if S-1 is str then lowercase)
  125. 1110 2 - ceiling (or if S-1 is str then capitalize)
  126. 1111 - sub (if one is string then replaces in S-3 S-1th thing with S-2)
  127.  
  128. 1010/11. stack:
  129. if S-2 isn't NUM 0 or STR " " or STR "" then LINESTACK codeline S-1. Note that it goes to line not byte.
  130.  
  131. 1011/12. exit:
  132. removes last thing from LINESTACK.
  133.  
  134. 1100/13. repeat:
  135. write once before & after the loop. The before needs a following 1 and the ending - 0.
  136. Takes the S-1 before the 1st written thing as repeat times.
  137. If there is only one thing in linestack and there is a repeat in progress and the last line has just been executed, the repeat will loop back.
  138.  
  139. 1101/14. variable:
  140. 1 byte determines either to set(0) or get(1) a variable. set pops the value and get adds the var value to stack.
  141. 3 bytes determine which variable to get/set.
  142. Useful if long values have to get repeated.
  143. Contains 8 predetermined values in them. Find those in sprites parser parseInit custom block.
  144.  
  145. 1110/15: jump:
  146. jump to line S-1.
  147.  
  148. 1111/16: jump if:
  149. if S-2 isn't NUM 0 or STR " " or STR "" then jump to codeline S-1. Note that it goes to line not byte.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement