Implements the Fractran computation system, a Turing-complete esoteric programming language invented by John Conway. The program consists of a list of fractions, and computation proceeds by multiplying the current number by the first fraction whose denominator divides it.

Implements

Constructors

Properties

input: null | FractranNumber = null
program: readonly FractranFraction[]

Methods

  • Checks if the computation has halted. The computation halts when no fraction in the program can divide the current number.

    Returns boolean

    True if the computation has halted, false otherwise

    Throws

    If the input number is not set

  • Executes the specified number of computation steps. Stops early if the computation halts before completing all steps.

    Parameters

    • step: number

      The number of steps to execute

    Returns void

    Throws

    If the input number is not set

Generated using TypeDoc