We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

89 (machine)

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

89 is type of time machine.


Machine specification

An 89 machine has a frontend face and a backend foctal.

Frontend

This pseudocode renders the time-machine front-end

function fib(n){let a=0,b=1;for(let i=0;i<n;i++)[a,b]=[b,a+b];return a}
const f=fib(11),n=12,s=[];
for(let i=0;i<n;i++)s.push(f*(f+i));

const rows=[[[13,0]],[[6,11],[20,1]],[[2,10],[24,2]],[[0,9],[26,3]],[[2,8],[24,4]],[[6,7],[20,5]],[[13,6]]];

function draw(){
  const k=Math.floor(Date.now()/1000)%n;
  const out=[];
  for(const r of rows){
    let line=new Array(33).fill(' ');
    for(const [c,i] of r){
      const t=i===k?'['+s[i]+']':' '+s[i]+' ';
      for(let j=0;j<t.length;j++)line[c+j]=t[j];
    }
    out.push(line.join('').replace(/\s+$/,''));
  }
  d.textContent=out.join('\n')+'\n\n'+s[k];
}
draw();setInterval(draw,1000);

Backend

Backend is a Time based brainfoctal interpreter which increments "time" and removes the e.g 21,10,99,88,77,66,55,44,33,22,11,00 from each tick's octal string; returning it from the string to output with the brainfoctal program which executes at that time.
The brainfoctal interpreter is also modified to support an expedient XKCD Random Number

        if c == '5':
            if tape[p] == 4:
                print('4', end='')

This is main specification of the backend.

def run():
    start = get_clock_start()
    tick_ms = 89
    next_tick = time.time()
    while True:
        run_once(start)
        next_tick += tick_ms / 729
        sleep_for = next_tick - time.time()
        if sleep_for > 0:
            time.sleep(sleep_for)

if __name__ == "__main__":
    run()

External Resources

  • A backend interpreter can be found Here.

semantic note

A time machine is considered to be any type of machine which relates to Time.