IDTM

From Esolang
Jump to: navigation, search

IDTM, or Infinite Dimensional Tengwar Meltdown, is an esoteric programming language written by Tom Price-Nicholson in 2014. IDTM draws together ideas from his earlier programming languages Dimensions and RingCode, and also incorporates ideas from User:Rottytooth's esolang Entropy. IDTM uses the Tengwar script from Lord of the Rings as its syntax (RingCode). It behaves as if it has a pointer that moves through a multi-dimensional array (Dimensions). It incorporates the idea that the data decays over time (Entropy). Each dimension in the array is infinite in length, and there are an infinite number of dimensions that the pointer can move in (got a headache yet?)

Syntax

The instructions are given in the Tengwar script from Lord of the Rings. If you are interested, a translation can be found here. The actual value of each tengwa (a letter in Tengwar) does not matter, so you can use them to write comments or phrases, etc. You can even use them to disguise your program. The instructions are given by the tehtar, the diacritical marks placed above or below each tengwa. 12 tehtar (plus no tehtar, leading to 13 variations) are used to give instructions.

The array

The array consists of an infinite number of dimensions, labeled from 0 to ∞. Each dimension consists of an infinite number of cells, labeled from 0 to ∞. Each cell can hold a char value or an int value, but not both. If a cell holds one type and you try to affect the other, the type that it holds is wiped. The int values are incremented and decremented in the usual fashion (±1), and the char values are incremented and decremented by replacing the char with the char one place along from it in this list:

(empty)abcdefghijklmnopqrstuvwxyz(space)ABCDEFGHIJKLMNOPQRSTUVWXYZ.,!?()[]{}=+-*/\%"£$€^&_:;@'~#<>|¬`¦

¦ increments to (empty) and (empty) decrements to ¦. To begin with, every char is (empty) and every int is 0.

The Tehtar

12 tehtar are used to give instructions. Two of the tehtar go underneath the tengwa character: double dot (..) and underline (_). The other ten go above the tengwa character: chevron (^), triangle (...), dot (.), dash (/), left curl (ˀ), right curl (ˁ), doubled dot (..), doubled dash (//), doubled left curl (з) and doubled right curl (ԑ). Note that double dot and doubled dot are two different tehtar.

Instructions

  • No tehtar - no operation.
  • .. - increment the position of the pointer (move one space forwards).
  • _ - decrement the position of the pointer (move one space backwards).
  • ^ - increment the value of the dimension that the pointer is moving in.
  • ... - decrement the value of the dimension that the pointer is moving in.
  • . - set the int value to 0, then increment the char value of the cell.
  • / - set the int value to 0, then decrement the char value of the cell.
  • ˀ - begin loop. If cell holds no char and an int of 0, skip to the instruction immediately after the next ˁ instruction. Otherwise, continue.
  • ˁ - end loop. Skip back to the most recent ˀ instruction.
  • .. - set the char value to (empty), then increment the int value of the cell.
  • // - set the char value to (empty), then decrement the int value of the cell.
  • з - if the char value is (empty), output the int value of the current cell. Otherwise, output the char value.
  • ԑ - empty the cell, then ask for an input. Input the first char or int value that is given.

Entropy

After each instruction is executed, it is changed. The (no tehtar), ˀ and ˁ instructions cannot be changed, and other instructions cannot be changed into them. Otherwise, any change is allowed. As the change is implemented after the instruction is executed, it does not affect instructions that are only executed once. Programs that contain no loops are therefore immune to entropy. Programs that contain loops that are executed many times end up looking like garbage. An instruction may be changed into itself. The actual source code is unaffected, so if a program is run many times, it will produce similar output each time.

Example programs

If anybody comes up with some example programs, feel free to post them here.

See also

External resources

Tengwar alphabet, Wikipedia