Folder

From Esolang
Jump to navigation Jump to search
Not to be confused with Folders.

The Folder programming language is an esoteric programming language by User:Rdococ with a variety of interpreters, compilers and intermediary formats.

Semantics

A Folder contains various files and other folders. The user can send input to the program by navigating to other folders and opening files to alter the state of the currently running program.

Folders can contain images, videos and documents for output. Extensions to Folder support embedding programs written in other, potentially Turing complete programming languages.

Usage

Folder is an interpreted programming language. Almost every operating system comes with a Folder interpreter pre-installed, and one of the simplest is the cd command. Microsoft Windows offers the commonly used interpreter Explorer, and a wide variety of open-source interpreters are available for Linux.

Folder programs can be compiled into a set of intermediary bytecode formats, the most common of which is .zip.

Examples

This Folder represents a turnstile. Beginning in the 'closed' state, you can open 'unlock' to open the turnstile, and 'lock' to close it again.

  • lock
  • closed (hidden)
  • unlock => opened
  • opened (hidden)
  • lock => closed
  • start => closed

A Folder for adding 2 binary numbers of arbitrary sizes. Input should alternate between the two numbers starting from the LSB e.g. to calculate 1010 + 0011, follow the links 01110010 while memorizing the sequence of images.

  • adder
  • A=0
  • B=0 (=> "out_0")
  • B=1 (=> "out_1")
  • A=1
  • B=0 (=> "out_1")
  • B=1 (=> "out_0_carry")
  • out_0 (hidden)
  • 0.png
  • next (=> "adder")
  • out_1 (hidden)
  • 1.png
  • next (=> "adder")
  • out_0_carry (hidden)
  • 0.png
  • next (=> "adder_carry")
  • out_1_carry (hidden)
  • 1.png
  • next (=> "adder_carry")
  • adder_carry (hidden)
  • A=0
  • B=0 (=> "out_1")
  • B=1 (=> "out_0_carry")
  • A=1
  • B=0 (=> "out_0_carry")
  • B=1 (=> "out_1_carry")