From Esolang
Jump to navigation Jump to search

™ or TM is an esolang (or, a family of esolangs) that can do a Truth Machine (except type 4 and 11, which are basically jokes), created by User:None1.

Syntax

Dialects created in 2023

Type 1

There is only one valid program: , which is a Truth Machine.

Other programs raise a syntax error:

Syntax error

Type 2

There are only three valid programs:

  1. , which is a Truth Machine.
  2. ©, which is a cat program.
  3. ®, which is a reverse cat program.

Other programs raise a syntax error:

Syntax error

Type 3

There is only one valid program: an empty program, which is a Truth Machine.

Other programs raise a syntax error:

Syntax error

Type 4

Every program raises a syntax error:

Syntax error

It is obvious that type 4 is a Nope. derivative.

Type 5

Every program is a Truth Machine.

Type 6

Every program that isn't empty is a Truth Machine.

An empty program raises a syntax error:

Syntax error

Dialects created in 2024

Type 7

There is only one valid program: , which is a Truth Machine.

Other programs delete themselves.

Type 8

Any program that is not is a Truth Machine.

raises a syntax error:

Syntax error

Type 9

There are only three valid programs:

  1. , which is a Truth Machine.
  2. ©, which is a Truth Machine.
  3. ®, which is a Truth Machine.

Other programs raise a syntax error:

Syntax error

Type 10

There is only one valid program: , which is a Truth Machine.

Other programs do nothing.

Type 11

Every program does nothing.

This is the same as APLWSI.

Example Programs

Type 1

Truth Machine

Quine

Syntax error

Type 2

Cat Program

©

Reverse Cat Program

®

Truth Machine

Quine

Syntax error

Type 3

Truth Machine


The Truth Machine for type 3 is shorter than Truth Machine in any other language.

Quine

Syntax error

Type 4

Quine

Syntax error

Self interpreter

No matter what this is.

Self interpreter 2

Syntax error

Type 5

Truth Machine


Alternative
Hello World!

Type 6

Truth Machine

Truth Machine

Type 7

Truth Machine

Delete itself

Any text can go here

Type 8

Truth Machine

Any text can go here (really?)

Type 9

Truth Machine

©
®

Are all truth machines.

Quine

Syntax error

Type 10

Truth Machine

Interpreter for type 11/APLWSI/Nil

Anything can go here

Type 11

Self interpreter/Nil/APLWSI interpreter

Anything can go here

Interpreters

The following interpreters are in Python.

Type 1

import sys
code=sys.stdin.read()
if code=='™':
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)
else:
    print('Syntax error')

Type 2

import sys
code=sys.stdin.read()
if code=='™':
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)
elif code=='©':
    print(sys.stdin.read())
elif code=='®':
    a=input()
    l=list(a)
    l.reverse()
    print(''.join(l))
else:
    print('Syntax error')

Type 3

import sys
code=sys.stdin.read()
if code=='':
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)
else:
    print('Syntax error')

Type 4

print('Syntax error')

Type 5

import sys
code=sys.stdin.read()
if True:
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)
else:
    print('Syntax error') # Just kidding!

Type 6

import sys
code=sys.stdin.read()
if code:
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)
else:
    print('Syntax error')

Type 7

import sys,os
code=sys.stdin.read()
if code=='™':
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)
else:
    os.remove(sys.argv[0])

Type 8

import sys
code=sys.stdin.read()
if code!='™':
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)
else:
    print('Syntax error')

Type 9

import sys
code=sys.stdin.read()
if code in list('™©®'):
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)

else:
    print('Syntax error')

Type 10

import sys
code=sys.stdin.read()
if code=='™':
    x=input()
    if x=='0':
        print(0)
    else:
        while 1:
            print(1)

Type 11

N