PLAWIHA

From Esolang
Jump to navigation Jump to search

PLAWIHA (Programming LAnguage WIth Heavy Accent) is an esolang by User:BoundedBeans using only Unicode combining characters. It was created entirely independantly of Zalgo, though their premises are very similar.

Variables

To declare a variable duh, we would use something like: àaͩaͧaͪå(value)å You don't have to specify the type of the variable, but the type of the value you assign it is the type that variable will have permanently. To reassign a variable, use the cedilla: ̧ , followed by an expression containing only a variable value, which can include a key if the variable is an array, followed by a ring above, followed by the expression to set it to, followed by a ring above..

I/O

To input, use the grave below: ̖ Follow with the variable to input into, and a ring above. The input type depends on the variable's type. Numeric variables will input a decimal number, while array variables will input as a line of text. To output, use the acute below: ̗ Follow with the variable to output, and a ring above.. If there is an array inside of an array, the entire outer array will be printed in JSON array syntax.

Expressions

There are two types in PLAWIHA, numbers and arrays. Arrays can be of arrays, and they can contain both numbers and other arrays in the same arrays. Note that all arrays are dynamic, but adding and removing elements must be done by expressions, and actually having the adding or removing affect anything requires reassigning the array.

Expressions are made of values and operators. Values begin with a diaresis above, also known as the umlaut: ̈, and they end with a diaresis below: ̤ . This allows nested values for things like arrays. Expressions do not have any form of brackets, so you will have to break things down into their parts. In fact, you can only have one operator in an expression (you can also have no operator; in this case, only one outer-level value should be used).

Also, using umlauts with nothing in between allows you to delete a variable, or an array element. This is useful for dictionaries, since the keys can never be removed with an operator.

Numerical values

Numerical values are made in binary using the circumflex and the tilde: ̂ ̃ The circumflex is 0 while the tilde is 1. Numbers are 64-bit, but they may specify less bits in the syntax, filling all other bits with 0.

Array values

Arrays start with a double low line ̳ and end with a double overline ̿, all inside of the diaresises. They contain zero, one, or many inner-values, which can be numbers or arrays. Each value in the array is

Variable values

Variable values are started with a left arrowhead below and ended with a right arrowhead below: ͔ ͕ (this may be very hard to see in some fonts). Inside, the variables name should be contained using the medieval accent letters. If it is an array position, it should be contained within a turned comma above and a comma above after the variables name but still inside the arrowheads: ̒ ̓ (may also be difficult to see in some fonts). Array positions can be an array, allowing dictionaries/maps to be created. This dictionary mechanic can only be used when reassigning the array, not declaring and initializing it. Array keys in arrays will be automatically created when assigned, while numerical keys need to be created before they can be assigned. There can be multiple array positions/keys in one value, but they all should have their own diacritic commas, and the order does matter. This is useful for matrices. Anywhere where a numerical argument is wanted, a variable of numerical type or a numerical element of an array can be used, while anywhere an array is needed, an variable of array type or an array element of an array can be used.

Operators

There can only be one operator per expression. Operators are (number) plus (number): ̟ (number) minus (number): ̄ (number) times (number): ͙ (number) divided by (number): ̸ (number) modulo (number): ̷ (array) insert zero at position (number): ̡ (array) remove element at position (number): ̢

If the position is negative for the array operators, it will add or remove relative to the length of the array (only numerical elements though).

Labels

Before any statement, a label may be used. Labels are the same as variable values, having a name made out of medieval accent letters, but they begin and end with a fermata: ͒ There should never be this character in label names, so the beginning and end character can be the same. Put the label name outside of any statement, or in a go-to.

Flow control

The if-statement and go-to are at one here. An expression is used first, followed by the ring above. Follow that with the label name in fermatas, and follow that with another ring. The expression is tested, and if it is greater than zero, execution will pass to the label. Also, if the expression evaluates to an array, it will choose randomly between going to the label and not doing so.

Examples

Hello world

àaͭaͤaͯaͭåäa̳
äãââãâââa̤
äããââãâãa̤
äããâããââa̤
äããâããââa̤
äããâããããa̤
äãâââââa̤
äãããâãããa̤
äããâããããa̤
äãããââãâa̤
äããâããââa̤
äããââãââa̤
äãââââãa̤
a̿a̤
a̗aͭaͤaͯaͭå