enGLish

From Esolang
Jump to navigation Jump to search

enGLish /iŋgˈʌliʃ/ is an esolang invented by User:None1 that is like English. It has graphical output, thus the name.

Syntax

  • Commands are separated by line feeds.
  • Case sensitive.
  • Contiguous whitespaces are treated as one space (except in strings).

For example:

Output        123

is the same as:

Output 123
  • Whitespaces at the start or end of a line are ignored.
  • Periods may exist at end of lines, but they are ignored.

For example:

Output 123.

is the same as:

Output 123
  • Errors are ignored.
  • You don't need spaces between punctuations/digits and letters/punctuations/digits (except in strings).

For example:

Output"a"

is the same as:

Output "a"

But:

Output " a"

is not the same as:

Output "a"

also:

Declare a variable named x,initially three

is the same as:

Declare a variable named x, initially three

also:

Declare a variable named x,initially 3

is the same as:

Declare a variable named x , initially3

Commands

Commands explain themselves:

Graphics

A 500x500 white canvas is given for graphical output.

Draw a pixel of color (R,G,B) at (x,y)

Arithmetic

Store the (sum/difference/product) of x and y into z.
Store the (quotient/remainder) of x divided by y into z.

I/O

Input x
Input x as character
Output x
Output character x
Output a line feed
Output "string"
Output the program's source code

NO escape sequences in strings!

Control flow

Jump to line x if y is (not/) (zero/(equal to/less than/greater than) z)
Jump to line x
Terminate the program

x can be a variable.

Variables

All variables are signed bignums.

Declare a variable named x, initially integer

The integer must be an integer literal.

Literals

They are numbers or words, words only allow zero to ten.

Examples

Hello world

Output "Hello, World!"

Draw a blue line at the top of canvas

Declare a variable named x, initially 499
Draw a pixel of color (0,0,127) at (x,0)
Store the difference of x and 1 into x
Jump to line 2 if x is greater than -1

Cheating Quine

Output the program's source code

It is a polyglot, because it also works in Output.

A+B Problem

Declare a variable named a, initially 0
Input x
Declare a variable named b, initially 0
Input y
Declare a variable named sum, initially 0
Store the sum of a and b into sum
Output sum

You have to initialize even if it is unneccessary to do that.

XKCD Random Number

Output four

Alternative

Output 4
Alternative
Output "4"

Alternative

Output character 52

Truth Machine

Declare a variable named x, initially 0
Input x
Output x
Jump to line 2 if x is not zero

Cat program

Declare a variable named c, initially 0
Input c as character
Output character c
Jump to line 2

See also