@uniiem/brainfuck
v0.1.0
Published
The reimplementation of BrainfuckJs using TypeScript.
Downloads
7
Readme
@uniiem/brainfuck
The reimplementation of BrainfuckJs using TypeScript.
Installtion
npm i @uniiem/brainfuck
API
declare const setDebug: (value: boolean) => boolean;
declare const execute: (program: string, input?: string) => Promise<unknown>;
declare const executeCallbackly: (program: string, input?: string, callback?: Callback) => Promise<unknown>;
// Type Definations
export type Operation = Record<string, () => void>;
export type Operator = "+" | "-" | ">" | "<" | "[" | "]" | "." | ",";
export type Callback = (runtime: Runtime) => void;
export interface Runtime {
operator?: Operator | null;
memory: Uint8Array;
pointer: number;
input: string;
output_buffer: string;
exited: boolean;
}
Sponsor
Buy me a coffee~