XENBLN/Commands

From Esolang
Jump to navigation Jump to search
Back to XENBLN

A list of all XENBLN commands as of October 23th, 2022.

This language was designed to have minimal errors.
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 it takes a Boolean value as a parameter, it will convert the parameter to false if it is 0, 0.0, "", f (false), û (undefined), or ñ (NaN), else it will convert it to Boolean true.
Therefore, it is not generally necessary to use type-casting functions unless you're using = (equality) or ≠ (inequality) or writing a switch statement case or for loop value to iterate over/number of iterations.
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.
All variables (a, b, c, l, m, and n) are initialized to û (undefined).
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).
'X evaluates to (true/false)' really means 'bool(X) evaluates to (true/false)'.

0. α : Number literal A (group A).
1. β : Number literal B (group A).
2. γ : Number literal C (group A).
3. δ : Number literal D (group A).
4. ε : Number literal E (group A).
5. ζ : Number literal F (group A).
6. η : Number literal A (group B).
7. θ : Number literal B (group B).
8. ι : Number literal C (group B).
9. κ : Number literal D (group B).
10. (newline) : 
11. λ : Number literal E (group B).
12. μ : Number literal F (group B).
13. : 
14.  : 
15.  : 
16.  : 
17.  : 
18.  : 
19.  : 
20.  : 
21.  : 
22.  : 
23.  : 
24.  : 
25.  : 
26.  : 
27.  : 
28.  : 
29. ≤ : (Arguments A, B) Returns A <= B.
30. ≥ : (Arguments A, B) Returns A >= B.
31. ≠ : (Arguments A, B) Returns A !== B.
32. (space) : 
33. ! : (Argument A) Returns Boolean NOT(A).
34. " : String literal opener and terminator.
35. # : (Argument A) Returns int(A).
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}.
37. % : (Arguments A, B) Returns A modulo B.
38. & : (Arguments A, B) Returns Boolean AND(A, B).
39. ' : (Argument A) Returns string(A).
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. Using variadic parameters (varargs) is not possible, but you could emulate this by using an array as a parameter.
41. ) : When used in a function, returns an array of all parameters passed; when used anywhere else, it will return an empty array.
42. * : (Arguments A, B) Returns A multiplied by B (the product of A and B; A * B).
43. + : (Arguments A, B) Returns A added to B (the sum of A and B; A + B).
44. , :
45. - : (Arguments A, B) Returns A minus B (B subtracted from A; the difference of B and A; A - B).
46. . : Decimal point in a number literal, e.g. 3.14 -> 3.14.
47. / : (Argument A) Returns and removes the Ath item in the Array. See also \.
48. 0 : Number literal 0 (group A).
49. 1 : Number literal 1 (group A).
50. 2 : Number literal 2 (group A).
51. 3 : Number literal 3 (group A).
52. 4 : Number literal 4 (group A).
53. 5 : Number literal 5 (group A).
54. 6 : Number literal 6 (group A).
55. 7 : Number literal 7 (group A).
56. 8 : Number literal 8 (group A).
57. 9 : Number literal 9 (group A).
58. : : (Argument A) Pushes A to the Array.
59. ; : (Arguments A, B) Inserts A to the Array at index B.
60. < : (Arguments A, B) Returns A < B.
61. = : (Arguments A, B) Returns A == B.
62. > : (Arguments A, B) Returns A > B.
63. ? : Returns the last item in the Array.
64. @ : Starts a function with no parameters. Syntax: @your code here}
65. A : (Argument A) Returns the absolute value of A.
66. B : (Argument A) Converts A to a string, then lowercases and returns the string.
67. C : Same as {„.
68. D : (Argument A) Returns float/double(a).
69. E : (Argument A) Converts A to a string, then uppercases and returns the string.
70. F : (To be used before }) Specifies a loop type of 'for loop'. See also x, y.
71. G : (Argument A) Returns the length of string or array A, the value of int/float/double A, 0 or 1 for Boolean A, else 0.
72. H : (Argument A) Converts A to a string, then uppercases the first character of the string and returns the string.
73. I : Returns user input as a string. No input returns an empty string.
74. J : 
75. K : 
76. L : (Arguments A, B) Returns the Levenshtein distance of A and B.
77. M : Returns user input as a float/double. Invalid input returns 0.0.
78. N : Returns user input as an integer. Invalid input returns 0. Same as #I.
79. O : (Argument A) Outputs A with a newline (see also œ).
80. P : (Arguments A, B) Returns bitwise OR(A, B).
81. Q : Quits the program immediately.
82. R : Empty array. Same as [].
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.
84. T : (Arguments A, B, C) Ternary statement. If A evaluates to true, returns B, otherwise returns C.
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.
86. V : (Argument A) Returns string/array A reversed.
87. W : (To be used before }) Specifies a loop type of 'while loop'. Loops while ¡condition. See also U.
88. X : (Arguments A, B) Returns bitwise XOR(A, B).
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).
90. Z : (Arguments A, B) Returns bitwise AND(A, B).
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.
92. \ : Returns the popped last item in the Array. See also /. In strings, \\ -> \, \n -> (newline), \t -> (tab), \" -> ", \r -> (carriage return), \f -> (form feed).
93. ] : End of array literal. Not to be confused with the Array.
94. ^ : (Arguments A, B) Returns A to the power B.
95. _ : (Argument A) Returns floor(A).
96. ` : (Argument A) Array-pushes all characters of string A separately, or all items of array A separately, or else just pushes A.
97. a : Global variable a.
98. b : Global variable b.
99. c : Global variable c.
100. d : The number 100.
101. e : Mathematical constant e (Euler's number).
102. f : Boolean false.
103. g : 
104. h : Mathematical constant phi (golden ratio).
105. i : Infinity.
106. j : Negative infinity.
107. k : 
108. l : Function variable l. Intented for use in functions but can be used as a normal variable too.
109. m : Function variable m. Intended for use in functions but can be used as a normal variable too.
110. n : Function variable n. Intended for use in functions but can be used as a normal variable too.
111. o :
112. p : Mathematical constant pi (3.14159...).
113. q : The number ¼. Same as ÷o4.
114. r : Last computed result.
115. s : Empty string. Same as "", or " at EOF.
116. t : Boolean true.
117. u :
118. v :
119. w : (Argument A) Same as WA} (replace A with A).
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.
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.
122. z :
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 ¶.
124. | : (Arguments A, B) Returns Boolean OR(A, B).
125. } : Loop closer (syntax: <loop type><condition><code>}). 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.
126. ~ : (Argument A) Returns -A (negative A).
127. Œ : (Argument A) Outputs A without a newline.
128. œ : Outputs a newline (see also O).
129. ০ : Number literal 0 (group B).
130. ১ : Number literal 1 (group B).
131. ২ : Number literal 2 (group B).
132. ৩ : Number literal 3 (group B).
133. ৪ : Number literal 4 (group B).
134. ৫ : Number literal 5 (group B).
135. ৬ : Number literal 6 (group B).
136. ৭ : Number literal 7 (group B).
137. ৮ : Number literal 8 (group B).
138. ৯ : Number literal 9 (group B).
139. ▽ : (Arguments A, B, C) Returns the sum of A, B, and C (A + B + C).
140. θ : (Argument A) Returns cos(A).
141. Σ : (Argument A) Returns the sum of sequence A, else returns tan(A), else returns A.
142. ʒ : (Argument A) Returns sin(A).
143. ✦ : (Argument A) Return the negative absolute value of A. Same as ~AA.
144. Č : (Arguments A, B) Compound do-while loop for 1 command, see U for execution rules (same as UAB}).
145. č : (Arguments A, B, C) Compound do-while loop for 2 commands, see U for execution rules (same as UABC}).
146. √ : (Argument A) Returns the square root of A.
147. Š : (Argument A) Returns the string "Š" concatenated with argument A. For any non-string value of A, this is a quine function.
148. š : The string "Hello, World!".
149. Ź : (Argument A) Compound infinite loop for 1 command, executes command A forever (same as ∞A}).
150. ź : (Arguments A, B) Compound infinite loop for 2 commands, executes commands A and B forever (same as ∞AB}).
151. ≈ : (Arguments A, B) Checks if the types of A and B are the same. Same as =YAYB.
152. ∞ : Specifies a loop-type of 'infinite loop'.
153. „ : 1-character string literal, syntax „c where c is any character.
154. ˜ : (Argument A) Returns bitwise NOT(A).
155. Ń : (Argument A) Same as !ÑA.
156. ń : Type 'int' (integer). To be used with the type command (Y).
157. Ż : (Arguments A, B) Compound while loop for 1 command, executes command B while A evaluates to true (same as WAB}).
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}).
159. Ž : (Arguments A, B) Compound for loop for 1 command, same execution rules as a for loop (same as FAB}).
160. ž : (Arguments A, B, C) Compound for loop for 2 commands, same execution rules as a for loop (same as FABC}).
161. ¡ : (Argument A) Returns A evaluated to a Boolean value (same as !!A).
162. ¢ : (Argument A) Sets the first item of the Array (index 0) to A. Same as ©zA.
163. £ : (Argument A) Sets the last item of the Array (index -1) to A. Same as ©õA.
164. ¤ : (Arguments A, B) Returns a randomly-generated integer from A to B, A/B inclusive.
165. ¥ : Returns the first element of the Array (index 0). Same as ®z.
166. ¦ : (Arguments A, B) Returns Boolean XOR(A, B).
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'.
168. ¨ : Returns the last element of the Array (index -1); if the Array is empty returns undefined. Same as ®õ.
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.
170. ª : Same as JavaScript Math.random().
171. « : String separator, e.g. "abc""123" = "abc«123".
172. ¬ : (Argument A) Returns a randomly-generated integer from 0 to A (from A to 0 if A is negative).
173. ‰ : (Argument A) Returns [1, …, A + 1].
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.
175. ¯ : (Argument A) Returns ceil(A).
176. ° : (Argument A) Returns A in radians (pass A as degrees).
177. ± : (Argument A) Returns 1 if A > 0, -1 if A < 0, and 0 otherwise. Same as T>AzoT<Azõz.
178. ² : (Argument A) Returns the square of A (A2). Same as ^A2.
179. ³ : (Argument A) Returns the cube of A (A3). Same as ^A3.
180. ´ : 
181. µ : Returns a randomly-generated float from 0 to A (from A to 0 if A is negative).
182. ¶ : (To be used with if/switch statements) Specifies an 'else' in an if statement and a 'default' in a switch statement. See also {.
183. · : (Arguments A, B) Returns A integer divided (floor divided) by B (A // B).
184. ¸ : (Argument A) Returns A in degrees (pass A as radians).
185. ¹ : 
186. º : 
187. » : (Arguments A, B) Returns the Ath character of string B; if out of range returns empty string "".
188. ¼ : (Argument A) Return a quarter of A. Same as ÷o4.
189. ½ : (Argument A) Returns half of A. Same as ÷o2.
190. ¾ : 
191. ¿ : (Arguments A, B) Returns A/B as a percentage. Same as *÷ABd.
192. À : (Arguments A, B) Returns string(A) extended by string(B); if A is û sets A to "" (s), the same goes for B.
193. Á : (Arguments A, B) Returns array(A) extended by array(B); if A is û sets A to [] (R), the same goes for B.
194.   : 
195. à: 
196. Ä : 
197. Å : 
198. Æ : 
199. Ç : (Arguments A, B) Returns array A extended by array B, else string(A) concatenated with string(B).
200. È : (Argument A) If A is an integer or a floating-point, return the Unicode character whose codepoint is A (A will be floored if it is a floating-point). If A is a string, return the Unicode codepoint of its first character, or zero if it is empty. If A is an array, apply this command to all its elements and return the resulting array (but do not modify A). If A is a boolean, return "true" if it is true and "false" if it is false. If A is undefined, NaN, or invalid type, return "undefined", "NaN", or "invalid type" respectively.
201. É :
202. Ê : Same as Ë followed by !
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}).
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.
205. Í : (Arguments A, B) Compound if statement for 1 command, executes command B if A evaluates to true (same as ÏAB}).
206. Π: At the first call in the program, behaves like I; after, returns the input from the first call.
207. Ï : (To be used before }) Specifies a loop type of 'if statement'.
208. Р: Same as Ï!.
209. Ñ : (Argument A) Same as =#Añ
210. Ò : Same as Í!.
211. Ó : (Argument A) Returns [1, …, A + 1].
212. Ô : (Argument A) Returns [0, …, A].
213. Õ : (Arguments A, B) Returns [A, …, B].
214. Ö : (Argument A, B, C) Returns the equivalent of the Python code [i for i in range(A, B, C)].
215. × : 
216. Ø : (Argument A) Outputs A with a newline and then returns A.
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 or R (or maybe even run R from Python).
218. Ú : (Argument A) Same as ≠Aû.
219. Û : (Argument A) Same as =Aû.
220. Ü : Noop (no operation).
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].
222. Þ : (Argument A) Returns the reciprocal of A (1/A).
223. ß : String with only a space in it " ".
224. à : (Argument A) Same as +Ao.
225. á : (Argument A) Same as -Ao.
226. â : The number 256.
227. ã : (Argument A) Where A is a variable name, return its value then decrement its value (like A-- in C).
228. ä : (Argument A) Where A is a variable name, return its value then increment its value (like A++ in C). 
229. å : (Argument A) Where A is a variable name, decrements its value then returns its value (like --A in C).
230. æ : (Argument A) Where A is a variable name, increments its value then returns its value (like ++A in C).
231. ç : 
232. è : 
233. é : 
234. ê : 
235. ë : 
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.
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.
238. î : Resets the Î command (e.g., its next call would get user input again).
239. ï : 
240. ð : 
241. ñ : The constant NaN.
242. ò : 
243. ó : 
244. ô : 
245. õ : The number negative one.
246. ö : 
247. ÷ : (Arguments A, B) Returns A divided by B (A / B; A ÷ B). If A is a string, splits a copy of A at all its occurrences of B (as a string) and returns that copy instead.
248. ø : (Argument A) Outputs A without a newline and then returns A.
249. ù : 
250. ú : 
251. û : Undefined. Returned by commands like O, Œ, :, etc.
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.
253. ý : Placeholder value for Ý.
254. þ : 
255. ÿ : Invalid type. Returned by using the type command (Y) on {, }, or ¶.