Width (yayimhere)

From Esolang
Jump to navigation Jump to search

Width is an esoteric programming language created by User:Yayimhere, based on Bitwise Cyclic Teap, Folat, and An Odd Rewriting System. Its similair to BCT, but uses a sort of "addressing" allowing one to access strings within the data strings that arent at the start.

Memory

Memory is stored in three places:

  • A datastring, made up of symbols in the following alphabet.
  • An ordered list called the alphabet, which starts as [!, "], which could be considered a base(e.g binary, unary, ect.), with the first element being zero, and the last one being the highest element. When an "instance" of a symbol is removed from the string, they are "incremented" up in the alphabet. When every instance of a specific symbol is removed, then that symbol is removed from the alphabet.
  • A subsection of the datastring called the upper register, updated before every command, which has the highest value, with the width of the last value of the register. The register always starts are three. When the register is referenced, it references only it value, not it position.
  • Another subsection called the lower register, with the reading width of the higher register, which is the lowest value found. Both these have a bias towards the start of the string, and neither "wrap" around the string. The width is always decremented in such a fashion that both widths can be contained in the data string.
  • The upper place, which is the location of the upper register.
  • The lower place, which is the location of the lower register.
  • The pointer, which points to either the upper or lower place, starting with the lower.

Command set

The following is the command set of Width. Note that a program is composed of two parts, first the memory, then a space, then the actual program. The initial memory string must only be composed of ! and ", and must be length three.

  • (x;y): prepend the given symbol x to the currently pointed to place in the data string, if it ends with y.
  • |: swap the pointers current position with the one it is not pointing to.
  • ': rotate the alphabet one left.
  • &: remove the leftmost character from the currently pointed to place.
  • *: append the pointed to place to both the one not pointed to, and the one itself.
  • .: remove every instance of the pointed to place from the one in the not pointed to one, going from left to right.

Examples

Looping counter:

"""!!! (!;")

which develops the data string as follows:

"""!!!
!"""!!!
!!"""!!!
!!!"""!!!
!!!!"""!!!
!!!!!"""!!!
!!!!!!"""!!!

and so on, to infinity.