Str0ng%password

From Esolang
Jump to navigation Jump to search

Str0ng%password (or strongpw) is a string-rewriting esoteric programming language created by User:Li210 during two days of binging designer stimulants. The language only allows user to work with a single arbitrary type of data, referred to as the password.

Basic concepts

Password

Password is a string composed of at least one lowercase and uppercase letter of English alphabet, number and a special symbol (#, $, <, >, =, %, ?, !), while the total number of characters must be greater than eight. A password lacking any of these requirements will cause the program to stop.

Consecutive characters of the same type (besides special symbols) create a token, essentially an individual unit of information, which is modified during an operation.

Special symbols and actions

Each special symbol represents an action - instruction for modifying itself and neighboring tokens. These actions are:

  • < > = : Neighbors are compared; symbol is transformed to either 0 or 1; neighbors are removed. If only one neighbor is available, the result is always 0. Method of comparison is based on the left-side neighbor as shown in the following table
R\L Number Lowercase/uppercase Symbol
Number numerical value lexicographical order ASCII code vs value
Lowercase/uppercase value vs value of byte representation lexicographical order ASCII code vs ASCII code of first letter
Symbol value vs ASCII code lexicographical order ASCII code
  • ?: Stores right neighbor as a reference named after left neighbor; removes itself and both neighbors
  • #: Stores all tokens on its right as a reference named after left neighbor; removes itself and left neighbor
  • !: Uses left neighbor to search for a reference and transforms to its value; removes self and left neighbor; if no reference is found, transforms to uppercase token of REFERENCE
  • %: Switches positions of its neighbors; removes itself
  • ]: Removes all tokens on its left; [: removes all tokens on its right; removes itself
  • $: Waits for user input and transforms to it; can be multiple tokens
  • ^: Marks position for appending (if absent, tokens are appended to password's right end); removes itself


Operation

Operation is a process of modifying one password ("primary") with another one. Two possible operations exist in Str0ng%password - addition and subtraction. During an operation, tokens of the primary password are read from left to right and matched with the first available same-type token of the secondary password. The pairs of tokens are then processed as:

  • Numbers are treated as integers and undergo the appropriate mathematical operation.
  • Letters are treated as strings and are either concatenated (addition) or each matching letter is removed (subtraction)
  • Symbols of the primary password later execute their actions (see bellow), symbols of the secondary passwords are then appended to the primary (in both addition and subtraction). These symbols will be executed next operation.

This is followed by a sequence of additional events:

  • Symbols are transformed themselves according to the action they represent
  • Symbols modify neighboring tokens
  • All remaining tokens of the secondary passwords are summed together and appended to the primary password. In the case of subtraction, the resulting number becomes negative, while the resulting strings switch cases
  • If two same-type tokens become neighbors, they "merge" - for numbers this would mean that if 25 and 75 end up next to each other, they become 2575
  • The resulting password is checked
 Operation example:  
 123PASSword?123 + FOObar420!xxx
 ------> 543PASSFOO!xxx

Concatenated lowercase string "wordbar" has been removed by the "?". Without the additional "xxx", this operation would result in an invalid password.

Loops

To run a program in Str0ng%password, all operations must be enclosed within a loop. Loops are sequences of operations that are repeated either specified number of times or indefinitely. Operations of a loop are enclosed in { } and separated by line breaks. Each operation saves its result as an "active password". Such password can be referenced by -||- . Password formatted such as -|PAssW0RD69|- is used if there is no active password stored -> first operation of the first loop. Example of a loop

{5
-|PENIS00password25?XxXxX|- +  5KJHqwe2>97
-||- + naAnPE96aLOL!
}

This loop fires six times (first + five repetitions), resulting in:

PENISKJHA101passwordqwexnaXPExn1a!
PENISKJHAKJHA202passwordqwexnaqwenaXPEPExnn31a!
PENISKJHAKJHAKJHA303passwordqwexnaqwenaqwenaXPEPEPExnnn331a!
PENISKJHAKJHAKJHAKJHA404passwordqwexnaqwenaqwenaqwenaXPEPEPEPExnnnn3331a!
PENISKJHAKJHAKJHAKJHAKJHA505passwordqwexnaqwenaqwenaqwenaqwenaXPEPEPEPEPExnnnnn33331a!
PENISKJHAKJHAKJHAKJHAKJHAKJHA606passwordqwexnaqwenaqwenaqwenaqwenaqwenaXPEPEPEPEPEPExnnnnnn333331a!

Uses

Useless.

Implementations

A low-quality interpreter is available with pre-compiled binaries for Windows and Linux. As its author has put little to no effort into testing and debugging, the reliability of this interpreter is poor, further complicating Str0ng%password's potential application.

Examples

Hello, world!

{0
HJJJJJellojjjjjW0>0rld - JJJJJjjjjj0!
}
----> HelloW0rld!  

External resources