Book of Truth

From Esolang
Jump to navigation Jump to search

Book of Truth features that you use only a book & marks to compute. The esolang acts like game books. There're instructions on each page. The user flips between pages, sets, or removes bookmarks according to instructions of the current page, and recurse.

Though I would be appreciating if someone could make a simulator, Book of Truth is meant to be run by a human, not a machine! The page count & bookmark amount should be limited to guarantee that the book can be printed and marks don't get a mess.

Pages

Contents in pages serve as ROM. Each page contains 3 parts: section, tokens and lines.

Section

Continuous pages' edges are colored, divided into different sections. This information is referred when the program needs to navigate the bookmark in particular section.

Tokens

Each page has multiple different tokens. These information are referred as conditions.

Both the design of section and tokens are meant to downplay page numbers' role, and act as a substitution. Section takes the role of <> and tokens take the role of ==.

Bookmarks

All above do nothing to runtime data storage, and the only means of data storing is the current page number we're at. Thus bookmarks are introduced.

Bookmarks can be set or removed at any pages. Page doesn't keep multiple marks. The operation trying to set bookmark when the page already has one, or remove bookmark when the page doesn't have one, failed without triggering error.

The total amount of bookmarks are limited due to your Book of Truth. If you run out of them, error is thrown.

Lines

Lines are instructions. The user do the instructions in order, till there's a goto or halt

Instructions

You write instructions as lines.