~2O25-12345

From Esolang
Jump to navigation Jump to search

~2O25-12345 is an esolang by User:Yoyolin0409

2O25, 2025, ~, ~, -, +, /, *, ^, website, type name, and error name are all reserved words.

~2O25-12345 has the following value classes: str (string), num (number), var_name (variable name), array (array), dict (associative array), bool (Boolean value), type (data type name), error (program error name), hex (hexadecimal value), none (undefined).

Syntax

Text Mean
~2025 Program Start
~2O25 Program End
~<var_name>-<num> Define a variable using a name.
~-<num> Remove all variables that contain this number.
~-<var_name> Remove this variable
~-<error> Terminate when an error occurs.
~2025-<num> The loop begins and executes a number of times.
~2O25-<num> The loop terminates only when the corresponding number of iterations is reached.
~~<array>-<value>-<value>-.... Define the array with a name.
~~<array>-<value>~.... Remove a value from the array. The number of '~' indicates how many values ​​to remove, starting from the end of the array.
~~<array>+<value> Add a value to the end of the array.
~~<array>+<value>~ Add a value to the beginning of the array.
~~<array>+<value>~~+~~... To add a value to a specified position in an array, use ~ to indicate a position where the value is not yet available, and + to indicate the position where the value should be added.
~~<array>~~-~~... Removes a value from a specified position in an array. ~ indicates no position to remove from, and - indicates the position to remove from.
~~~<array> Converting an array to an associative array automatically pairs any two values ​​together, removing any that don't match. For example, an array of [1,2,3,4,5] will become [1:2,3:4] when converted to an associative array.
~~<array>~~+~~+... Swaps a value between two specified positions in an array. ~ indicates no position to move to, and + indicates the position to move to.
~~~<dict>-<value>-<var_name> Find the corresponding value in the associative array and store it in the variable.
~~~~<bool>-<value> Converts a value of another type to a Boolean value. The conversion rules are as follows: a string will be 1 if it is not "", num will be 1 if it is not 0, array will be 1 if it is not empty, dict will be 1 if it is not empty, byte will be 1 if it is not empty, var_name will be ignored and only its content will be checked, none will always be 0, error will always be 1, and type cannot be converted.
~~~<dict>- Print everything in the associative array in text form.
-~<var_name>-<str> Define the variable storing text using a name.
-~-<str> Remove all variables containing this text.
~<var_name>- Print the variables
~~<array>- Print everything in the associative array in text form.
~~~~<bool>- Print Boolean values
? <Judgment> if
! <Judgment> elif
?! The blocks below it are executed only if all the above checks are negative.
!? The blocks below it must be executed.
website <var_name or array or dict or bool> Connect to the nearest supporting device and then output the contents of <var_name>, <array>, <dict>, and <bool>(But not now.)
~<var_name>-null Define a variable with a name that contains nothing.
~unicode <array or num>-<var_name> Translate all numbers, single numbers, or single hexadecimal values ​​in an array into Unicode and store them in the corresponding var_name.
~ascii <array or num or byte>-<var_name> Translate all numbers, single numbers, or single hexadecimal values ​​in an array into ASCII and store them in the corresponding var_name.
~<var_name>-hex-<value> Define a hex with a name
~<var_name>+<var_name或value> Adding a value from one variable to another, as long as one of them is in string format, will behave like in Python. For example, when var = 1, ~var + 1 will make var become 2, and ~var + "1" will make var become "11". Stored in the previous one.
~<var_name>=<num> To convert a variable to a number, the prerequisite is that if it is text, it must contain only numbers. For example, if var="11", then ~var=num will make var become 11. Furthermore, numbers and Boolean values ​​can also be converted.
~<var_name>-<var_name或value> Subtracting one variable from another, as long as one variable is in str format, will have special uses. For example, when var = 11, ~var - 1 will make var become 10, and ~var - "1" will make var become "1". Stored in the previous one.
~<var_name>*<var_name或value> Multiplying the value of one variable by another will have special uses as long as the first variable is in str format. For example, when var = 2, ~var * 2 will make var become 4, and when var is "2", ~var * 2 will make var become "22". Stored in the previous one.
~<var_name>/<var_name或value> Dividing a value in one variable by another has special uses if either variable is in string format. For example, when var = 2, ~var * 2 will make var become 1; when var is "221", ~var / 2 will make var become "1". This needs further explanation. In the second case, its purpose is to remove all elements within a string that contain that string. Stored in the previous one.
~<var_name>^<var_name或value> Multiplying the value of one variable by another variable or value will have special uses if either of them is in string format. For example, when var = 2, ~var^3 will make var become 8; when var is "2", ~var^3 will make var become "222". In the second case, its purpose is to repeat the content of this string a certain number of times. Stored in the previous one.
# comment
func 2025-<value> The function begins with any name.
func 2O25-<value> The function ends, and its usage is similar to that of a loop.
func call-<value> Call function

Judgment

Text Mean
= equal to
& and
% or
| not ...
> Greater than
< Less than
<> or >< Less than or greater than
=< or <= Less than or equal to
=> or >= equal to or greater than
is Used to check the type of a value

Error

Text Mean
SyntaxError Using non-existent syntax
TypeError The category was specified incorrectly, or something that does not belong to the category was used in that category.
ValueError Specify something that does not exist
NameError Use keywords as variable names
What? /0??? Divide by zero, alternative name: DivineZeroError
NoStart Missing ~2025 or func~2025-<value>
NoEnd Missing ~2O25 or func~2O25-<value>
LoopError There is a ~2025-<num>, but no corresponding ~2O25-<num>.

Warn

Warnings and errors are equivalent, but warnings do not stop the program.

Text Mean
Useless Triggered when the command neither prints nor website.
UselessVar Triggered when a variable is completely uninvolved by anything else.
UselessFunc Triggered when a function is not involved in anything else.

Example

Hello, world!

~2025
-~a-Hello,
-~a-world!
~c-32
~unicode c-d
~a+d
~a+b
~a-
~2O25