We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Enrtopy++

From Esolang
Jump to navigation Jump to search

Creator and Name

Enrtopy++ is an esoteric programming language created by the User:Esolang1. This language is a successor to Enrtopy, which was designed to exist as a version of Entropy where variable data does not randomly change.

Syntax

The syntax is almost equal to Entropy, With the only differences being that:

  • semicolons are not required.
  • there exists a do loop that repeats instructions for a set amount of times.
  • a get function exists. It extracts all content from the input buffer.

As with both descendants of Enrtopy++, it is mandatory to declare the name of the program and have all code enclosed with straight brackets afterwards.

Similarly, Enrtopy++ also supports if and while statements, but does not support other conditional statements such as else if, else and for.

Datatypes

   Int      Integer datatype.
   Float    Real number datatype.
   Str      Array of characters.
   List     Array of any one of the 3 other datatypes.

When comparing integers or floats, it is possible to use the following binary comparison operators ==, !=, >, <, >=, <=. Strings and lists can be compared with == and !=.

Variables

In order to use a variable, the variable must be declared.

   declare <NAME> <TYPE>

After declaring the variable, it can be used.

   let <NAME> = <VALUE>
   let <NAME> = <EQUATION>

For lists, the expression will be the following.

   let <NAME> = [element, element, ...]

To access an element at an index,

   <NAME>[IDX]

Enrtopy++ is 0-indexed.

I/O

Output is executed with print like this:

   print <NAME>
   print <STRING>

All available content in the input buffer can be extracted with get (NAME specifies the name of the Str variable that will store the input.):

   get <NAME>

Examples

Hello, World!

   Program MyNamespace MyProgram [
       print "Hello, World"
   ]

Because there are no random changes in variable data, this program will always print out Hello, World.

Cat

   Program MyNameSpace MyProgram [
       declare s str
       get s
       print s
   ]

99 Bottles of Beer

   Program Rottytooth NinetyNineBottles [
       declare count real
       let count = 99
       
       while count > 0
       [
   	    if count < 99 
   	    [
   		   print count
   		   print " bottles of beer on the wall.\n"
   	    ]
   	    print count
   	    print " bottles of beer on the wall, "
   	    print count
   	    print " bottles of beer.\nTake one down, pass it around, "
   	    
   	    let count = count - 1
       ]
       print " no more bottles of beer on the wall."
   ]

See also

External Links