Advertisement
Guest User

XENBLN commands - March 19

a guest
Mar 19th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.53 KB | None | 0 0
  1. | This language was designed to have minimal errors.
  2. | Note: If a command takes an integer or float/double as a parameter, it will try to convert those parameters to integers, but if that results in ñ (NaN, not a number), they will be turned into zero. Similarly, if a command takes a string as a parameter, it will convert all those parameters to strings, or if a command takes a Boolean value as a parameter, it will convert that parameter to Boolean false if it’s 0, 0.0, “”, f (Boolean false), û (undefined), or ñ (NaN/not a number), else it will convert it to Boolean true. Therefore, it’s not necessary to use type-casting functions unless you’re using = (equality) or ≠ (inequality), writing a switch statement case or for loop value to iterate over/number of iterations, or possibly other reasons.
  3. | The ‘O’ command is now unnecessary except for outputting û (undefined) values, as all functions with return values other than û (undefined) automatically output their return values if they aren’t themselves arguments to other functions, unless passed to ü (the 1-argument noop command), which returns û (undefined) and therefore prevents its argument from being output.
  4. | All variables (a, b, c, l, m, and n) are initialized to û (undefined).
  5. | Autocompletion and parameter filling: Strings, arrays, loops, functions, and function calls (see the next sentence) are autocompleted at EOF if they wouldn’t be completed already. Also, missing parameters at EOF are set to û (undefined).
  6. | ‘X evaluates to (true/false)’ really means ‘bool(X) evaluates to (true/false)’.
  7.  
  8. 0. :
  9. 1. :
  10. 2. :
  11. 3. :
  12. 4. :
  13. 5. :
  14. 6. :
  15. 7. :
  16. 8. :
  17. 9. :
  18. 10. (newline) :
  19. 11. :
  20. 12. :
  21. 13. :
  22. 14. :
  23. 15. :
  24. 16. :
  25. 17. :
  26. 18. :
  27. 19. :
  28. 20. :
  29. 21. :
  30. 22. :
  31. 23. :
  32. 24. :
  33. 25. :
  34. 26. :
  35. 27. :
  36. 28. :
  37. 29. ≤ : (Arguments A, B) Returns A <= B.
  38. 30. ≥ : (Arguments A, B) Returns A >= B.
  39. 31. ≠ : (Arguments A, B) Returns A !== B.
  40. 32. (space) :
  41. 33. ! : (Argument A) Returns Boolean NOT(A).
  42. 34. " : String literal opener and terminator.
  43. 35. # : (Argument A) Returns int(A).
  44. 36. $ : (Arguments A, B) Sets variable A to B (A = a, b, or c (the normal variables); or A = l, m, or n (the function variables that can be used as normal ones if needed); or if A is a non-zero-args function, sets B (a, b, c, l, m, or n) to A with B’s value passed as the first argument (this might take up more args to be passed to B)). Can be used to create a zero argument function by using it with @: $vname@your code here}.
  45. 37. % : (Arguments A, B) Returns A modulo B.
  46. 38. & : (Arguments A, B) Returns Boolean AND(A, B).
  47. 39. ' : (Argument A) Returns string(A).
  48. 40. ( : Require a parameter within a custom function. With code C, a zero argument function can be written like @C}, a one-argument function like @(C}, a two-argument function like @((C}, etc. To sum this up, type ( n times at the start of your custom function, n being the number of parameters you want it to take. An arbitrary number of parameters is not possible, but you could emulate this by using an array as a parameter.
  49. 41. ) : When used in a function, returns an array of all parameters passed; when used anywhere else, it will return an empty array.
  50. 42. * : (Arguments A, B) Returns A * B.
  51. 43. + : (Arguments A, B) Returns A + B.
  52. 44. , : Number literal separator, e.g. the numbers 10 and 20 can be written separately as 10,20.
  53. 45. - : (Arguments A, B) Returns A - B.
  54. 46. . : Decimal point in a number literal, e.g. 3.14 -> 3.14.
  55. 47. / : (Argument A) Returns and removes the Ath item in the Array. See also \.
  56. 48. 0 : Number literal.
  57. 49. 1 : Number literal.
  58. 50. 2 : Number literal.
  59. 51. 3 : Number literal.
  60. 52. 4 : Number literal.
  61. 53. 5 : Number literal.
  62. 54. 6 : Number literal.
  63. 55. 7 : Number literal.
  64. 56. 8 : Number literal.
  65. 57. 9 : Number literal.
  66. 58. : : (Argument A) Pushes to the Array A.
  67. 59. ; : (Arguments A, B) Inserts to the Array A at index B.
  68. 60. < : (Arguments A, B) Returns A < B.
  69. 61. = : (Arguments A, B) Returns A == B.
  70. 62. > : (Arguments A, B) Returns A > B.
  71. 63. ? : Returns the last item in the Array.
  72. 64. @ : Starts a function with no parameters. Syntax: @your code here}
  73. 65. A : (Argument A) Returns abs(A). Same as T>nzn~n.
  74. 66. B : (Argument A) Returns str(A).lower().
  75. 67. C : Same as {„.
  76. 68. D : (Argument A) Returns float/double(a).
  77. 69. E : (Argument A) Returns str(A).upper().
  78. 70. F : (To be used before }) Specifies a loop type of ‘for loop’. See also x, y.
  79. 71. G : (Argument A) Returns the length of string or array A, the value of int/float/double A, 0/1 for Boolean A, else 0.
  80. 72. H :
  81. 73. I : Returns user input as a string. No input returns an empty string.
  82. 74. J :
  83. 75. K :
  84. 76. L : (Arguments A, B) Returns Levenshtein distance of A and B.
  85. 77. M : Returns user input as a float/double. No input returns 0.0.
  86. 78. N : Returns user input as an integer. No input returns 0. Same as #I.
  87. 79. O : (Argument A) Outputs A with a newline (see also œ).
  88. 80. P : (Arguments A, B) Returns bitwise OR(A, B).
  89. 81. Q : Quits the program immediately.
  90. 82. R : Empty array. Same as [].
  91. 83. S : (To be used before }) Specifies a loop type of ‘switch statement’. The regex to match a switch statement is as follows: /Svaluecode((\{value)+code)*(¶code)?\}/, or for those who don’t know regex, you start it with S, then follow it with {valuecode (the first time, don’t put a {) where value is the value to be switched and see later down. You can do this as many times as you want before you put any code, but only if you leave it empty. For example, SI„A{„BO“You said A or B”} (with the C command, this can be shortened to SICACBO“You said A or B”}, or because of EOF autocompletion (strings and loops are autocompleted at EOF) even further to SI„ACBO“You said A or B) would match both “A” and “B”. If you put a ¶code at the end, that code is the switch default, but is optional.
  92. 84. T : (Arguments A, B, C) Ternary statement. If A evaluates to true, returns B, otherwise returns C.
  93. 85. U : (To be used before }) Specifies a loop type of ‘do-while loop’, meaning that if a while loop-type wouldn’t run, the code will run anyway. See also W.
  94. 86. V : (Argument A) Returns string/array A reversed.
  95. 87. W : (To be used before }) Specifies a loop type of ‘while loop’. Loops while ¡condition. See also U.
  96. 88. X : (Arguments A, B) Returns bitwise XOR(A, B).
  97. 89. Y : (Argument A) Returns the type of A. Valid types are ‘int’ (integer), ‘float’, ‘double’, ‘bool’, ‘NaN’ (not a number), ‘undefined’, ‘looptype’ (returned by loop-type specifiers, e.g. F and W), and ‘invalid’ (returned by {, }, ¶, and unassigned characters).
  98. 90. Z : (Arguments A, B) Returns bitwise AND(A, B).
  99. 91. [ : Start of array literal. For example, an array with “Foo”, ”Bar”, 8, and Boolean false as its items would be written as [“Foo”“Bar”8f]. Not to be confused with the Array.
  100. 92. \ : Returns the popped last item in the Array. See also /. In strings, \\ -> \, \n -> (newline), \t -> (tab), \” -> “, \r -> (carriage return), \f -> (form feed).
  101. 93. ] : End of array literal. Not to be confused with the Array.
  102. 94. ^ : (Arguments A, B) Returns A to the power B.
  103. 95. _ : (Argument A) Returns floor(A).
  104. 96. ` : (Argument A) Array-pushes all characters of string A separately, or all items of array A separately, or else just pushes A.
  105. 97. a : Global variable a.
  106. 98. b : Global variable b.
  107. 99. c : Global variable c.
  108. 100. d : The number 100.
  109. 101. e : Mathematical constant e.
  110. 102. f : Boolean false.
  111. 103. g :
  112. 104. h : Mathematical constant phi.
  113. 105. i : Infinity.
  114. 106. j :
  115. 107. k :
  116. 108. l : Function variable l. Only meant for use in functions but can be used as a normal variable too.
  117. 109. m : Function variable m. Only meant for use in functions but can be used as a normal variable too.
  118. 110. n : Function variable n. Only meant for use in functions but can be used as a normal variable too.
  119. 111. o : The number one.
  120. 112. p : Mathematical constant pi.
  121. 113. q : The number ¼. Same as ÷o4.
  122. 114. r : Last computed result.
  123. 115. s : Empty string. Same as “”, or “ at EOF.
  124. 116. t : Boolean true.
  125. 117. u : The number two.
  126. 118. v : The number ten.
  127. 119. w : (Argument A) Same as WA} (replace A with A).
  128. 120. x : Reserved for the current item in the for loop, or if the loop is set to loop n times with no iteration, it’s equal to y; if the program is in a while loop, it’s equal to the item used for the condition (used in 3-byte truth-machine); or if the program isn’t in a for or while loop, it’s equal to s. See also F.
  129. 121. y : Reserved for the current index/number of the for/while loop iteration; if the program isn’t in a for or while loop, it’s equal to z. See also F.
  130. 122. z : The number zero.
  131. 123. { : (To be used with if/switch statements) Specifies an ‘else if’ in an if statement and a ‘case’ in a switch statement. See also C and ¶.
  132. 124. | : (Arguments A, B) Returns Boolean OR(A, B).
  133. 125. } : Loop closer (syntax: <loop type><condition><code>}), can be used as an infinite loop by using W (while) as the loop type and t (Boolean true) as the condition. Current loop types are W (while), Ï (if), F (for), S (switch), and ∞ (infinite loop). If you specify a for loop, replace <condition> with <iterator>—if <iterator> is an integer, the loop repeats that number of times; if it’s a string, it loops over that string; if it’s a Boolean value it loops once for true and no times for false; and if it’s anything else, the loop doesn’t execute. See also S for the switch statement regex, and see also Í, Ë, Ż, and Ž, the compound loops for 1 command.
  134. 126. ~ : Negative sign before number (-). Same as -zn.
  135. 127. Π: (Argument A) Outputs A without a newline.
  136. 128. œ : Outputs a newline (see also O).
  137. 129.  :
  138. 130. ‚ :
  139. 131. ƒ :
  140. 132. „ :
  141. 133. … :
  142. 134. † :
  143. 135. ‡ :
  144. 136. ˆ :
  145. 137. ‰ :
  146. 138. Š :
  147. 139. ‹ :
  148. 140. Π:
  149. 141.  :
  150. 142. :
  151. 143.  :
  152. 144. Č : (Arguments A, B) Compound do-while loop for 1 command, see U for execution rules (same as UAB}).
  153. 145. č : (Arguments A, B, C) Compound do-while loop for 2 commands, see U for execution rules (same as UABC}).
  154. 146. √ : (Argument A) Returns the square root of A.
  155. 147. Š : (Argument A) Returns the string “Š” concatenated with argument A. For any non-string value of A, this is a quine function.
  156. 148. š : The string “Hello, World!”.
  157. 149. Ź : (Argument A) Compound infinite loop for 1 command, executes command A forever (same as ∞A}).
  158. 150. ź : (Arguments A, B) Compound infinite loop for 1 command, executes commands A and B forever (same as ∞AB}).
  159. 151. ≈ : (Arguments A, B) Checks if the types of A and B are the same. Same as =YAYB.
  160. 152. ∞ : Specifies a loop-type of ‘infinite loop’.
  161. 153. „ : 1-character string literal, syntax „char where char is any (valid) character.
  162. 154. ˜ : (Argument A) Returns bitwise NOT(A).
  163. 155. Ń : (Argument A) Same as !ÑA.
  164. 156. ń : Type ‘int’ (integer). To be used with the type command (Y).
  165. 157. Ż : (Arguments A, B) Compound while loop for 1 command, executes command B while A evaluates to true (same as WAB}).
  166. 158. ż : (Arguments A, B, C) Compound while loop for 2 commands, executes command B then command C while A evaluates to true (same as WABC}).
  167. 159. Ž : (Arguments A, B) Compound for loop for 1 command, same execution rules as a for loop (same as FAB}).
  168. 160. ž : (Arguments A, B, C) Compound for loop for 2 commands, same execution rules as a for loop (same as FABC}).
  169. 161. ¡ : (Argument A) Returns A evaluated to a Boolean value (same as !!A).
  170. 162. ¢ : (Argument A) Sets the first item of the Array (index 0) to A. Same as ©zA.
  171. 163. £ : (Argument A) Sets the last item of the Array (index -1) to A. Same as ©õA.
  172. 164. ¤ : (Arguments A, B) Returns a randomly-generated integer from A to B, A/B inclusive.
  173. 165. ¥ : Returns the first element of the Array (index 0). Same as ®z.
  174. 166. ¦ : (Arguments A, B) Returns Boolean XOR(A, B).
  175. 167. § : (Arguments A, B, C) Returns a randomly-generated float/double from A to B, A/B inclusive, with C numbers after the decimal point; if C is zero or negative the number generated will end in ‘.0’.
  176. 168. ¨ : Returns the last element of the Array (index -1); if the Array is empty returns undefined. Same as ®õ.
  177. 169. © : (Arguments A, B) Sets the Ath item of the Array to B; if out-of-range pushes item B instead. Negative values of A will wrap around to the end of the Array.
  178. 170. ª : Same as JavaScript Math.random().
  179. 171. « : String separator, e.g. “abc””123” = “abc«123”.
  180. 172. ¬ :
  181. 173. ‰ : (Argument A) Returns [1, …, A + 1].
  182. 174. ® : (Argument A) Returns the Ath element of the Array; if out-of-range returns û (undefined). Negative values of A will wrap around to the end of the Array.
  183. 175. ¯ : (Argument A) Returns ceil(A).
  184. 176. ° :
  185. 177. ± : (Argument A) Returns 1 if A > 0, -1 if A < 0, and 0 otherwise. Same as T>AzoT<Azõz.
  186. 178. ² : (Argument A) Returns A2. Same as ^A2.
  187. 179. ³ : (Argument A) Returns A3. Same as ^A3.
  188. 180. ´ :
  189. 181. µ :
  190. 182. ¶ : (To be used with if/switch statements) Specifies an ‘else’ in an if statement and a ‘default’ in a switch statement. See also {.
  191. 183. · :
  192. 184. ¸ :
  193. 185. ¹ :
  194. 186. º :
  195. 187. » : (Arguments A, B) Returns the Ath character of string B; if out of range returns empty string “”.
  196. 188. ¼ : (Argument A) Return a quarter of A. Same as ÷o4.
  197. 189. ½ : (Argument A) Returns half of A. Same as ÷o2.
  198. 190. ¾ :
  199. 191. ¿ : (Arguments A, B) Returns A/B as a percentage. Same as *÷ABd.
  200. 192. À : (Arguments A, B) Returns string(A) extended by string(B); if A is û sets A to “” (s), the same goes for B.
  201. 193. Á : (Arguments A, B) Returns array(A) extended by array(B); if A is û sets A to [] (R), the same goes for B.
  202. 194. :
  203. 195. Ã :
  204. 196. Ä :
  205. 197. Å :
  206. 198. Æ :
  207. 199. Ç : (Arguments A, B) Returns array A extended by array B, else string(A) concatenated with string(B).
  208. 200. È : (Argument A) Same as the Python code chr(A).
  209. 201. É : (Argument A) Same as the Python code ord((A + “\0”)[0]).
  210. 202. Ê : Same as Ë!.
  211. 203. Ë : (Arguments A, B, C) Compound if/else statement for 1 command, executes command B if A evaluates to true otherwise executes command C. (same as ÏAB¶C}).
  212. 204. Ì : (Argument A) Returns user input as an integer with prompt A. No input returns 0. Same as ŒAcode to receive/process the input with no I/O commands in itN.
  213. 205. Í : (Arguments A, B) Compound if statement for 1 command, executes command B if A evaluates to true (same as ÏAB}).
  214. 206. Î : At the first call in the program, behaves like I; after, returns the input from the first call.
  215. 207. Ï : (To be used before }) Specifies a loop type of ‘if statement’.
  216. 208. Ð : Same as Ï!.
  217. 209. Ñ : (Argument A) Same as =#Añ.
  218. 210. Ò : Same as Í!.
  219. 211. Ó : (Argument A) Returns [1, …, A + 1].
  220. 212. Ô : (Argument A) Returns [0, …, A].
  221. 213. Õ : (Arguments A, B) Returns [A, …, B].
  222. 214. Ö : (Argument A, B, C) Returns the equivalent of the Python code [i for i in range(A, B, C)].
  223. 215. × :
  224. 216. Ø : (Argument A) Outputs A with a newline and then returns A.
  225. 217. Ù : (Argument A) Plots the 2D array A on the Cartesian plane; each item of A should contain an even number of elements as they will become X and Y and be joined; for example, Ù[[zzozzo][zooo]] would plot a closed right triangle and a line. The result is stored in a separate file, named cartesiann.??? where n is the file number and what file type, I don’t know. If I ever make this then maybe I’ll use numpy.
  226. 218. Ú : (Argument A) Same as ≠Aû.
  227. 219. Û : (Argument A) Same as =Aû.
  228. 220. Ü : Noop (no operation).
  229. 221. Ý : (Arguments A, B) Maps the function B to array A (put ý in place of the item of the array in B), e.g. Ý[zou]+oý -> [1, 2, 3].
  230. 222. Þ :
  231. 223. ß : String with only a space in it “ ”.
  232. 224. à : (Argument A) Same as +Ao.
  233. 225. á : (Argument A) Same as -Ao.
  234. 226. â : The number 256.
  235. 227. ã : (Argument A) Where A is a variable name, return its value then decrement its value (like A-- in C).
  236. 228. ä : (Argument A) Where A is a variable name, return its value then increment its value (like A++ in C).
  237. 229. å : (Argument A) Where A is a variable name, decrements its value then returns its value (like --A in C).
  238. 230. æ : (Argument A) Where A is a variable name, increments its value then returns its value (like ++A in C).
  239. 231. ç :
  240. 232. è :
  241. 233. é :
  242. 234. ê :
  243. 235. ë :
  244. 236. ì : (Argument A) Returns user input as a string with prompt A. No input returns an empty string. Same as ŒAcode to receive/process the input with no I/O commands in itI.
  245. 237. í : (Argument A) Returns user input as a float/double with prompt A. No input or an invalid int/float/double returns 0.0. Same as ŒAcode to receive/process the input with no I/O commands in itM.
  246. 238. î : Resets the Î command (e.g., its next call would get user input again).
  247. 239. ï :
  248. 240. ð :
  249. 241. ñ : NaN.
  250. 242. ò :
  251. 243. ó :
  252. 244. ô :
  253. 245. õ : The number negative one.
  254. 246. ö :
  255. 247. ÷ : (Arguments A, B) Returns A ÷ B.
  256. 248. ø : (Argument A) Outputs A without a newline and then returns A.
  257. 249. ù : The number negative five.
  258. 250. ú : The number negative two.
  259. 251. û : Undefined. Returned by commands like O, Œ, :, etc.
  260. 252. ü : (Argument A) 1-argument noop (no operation). Can be used to prevent A from being printed because A, undefined or not, will be the argument to command ü, which returns undefined, and therefore won’t be printed.
  261. 253. ý : Placeholder value for Ý.
  262. 254. þ :
  263. 255. ÿ : Invalid type. Returned by using the type command (Y) on {, }, or ¶.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement