Timing

From Esolang
Jump to navigation Jump to search

Timing is a timing-based Brainfuck+2-derivative created by User:Evylah. It's very similar to Titled and Brainfuck+2.

This is still a work in progress. It may be changed in the future.

Code execution

In Titled, the programs are written inside of the file name. In Timing, the state of the program won't change between two different executions. Timing can only run one instruction at a time. Technically Timing has no syntax because you cannot type any instructions.

Code writing

Running a Timing program can be very difficult. When run, the program will first retrieve the stored state of the last execution, then take the current unix timestamp and modulo it by 13. This will give a number from 1 to 12. It will then check for the number, run the instruction accordingly, and store the program state (memory, output and memory pointer), for the next time used.

Instructions

unix timestamp % 13 Brainfuck+2 command Function
1 + Increments the active cell by one.
2 - Decrements the active cell by one.
3 > Increments the memory pointer by one.
4 < Decrements the memory pointer by one.
5 [ If the active cell is 0, jump to the corresponding ]
6 ] If the active cell is not 0, jump to the corresponding [
7 . Output the active cell as a Unicode character.
8 : Output the active cell as a number.
9 , Take a character as user input and store its Unicode value in the active cell.
10 ; Take a numerical user input and store it in the active cell.
11 ' Toggle overflow mode. When on (which is by default), numbers behave like standard brainfuck, wrapping on 0 and 255. When off, numbers can be any integer.
12 r This one is not part of Brainfuck+2. This resets the program state.

The [ and ] commands will keep executing inside them. The loop body gets defined once [ gets hit, then when ] is hit everything inside will run. This means (I think) nested loops aren't supported, sadly.