Code is eso

From Esolang
Jump to navigation Jump to search

CODE IS ESO is an object oriented programming language inspired on the game "Baba is you" by the user DmilkaSTD. This language is not finished, after making the interpreter im gonna finish this page (Obviously the interpreter would be Open Source).

Hello world:

CODE IS SMART
NOTE ON HERE Hello world program
DISPLAY HAS "HELLO WORLD"

Using a class:

CODE IS SMART
NOTE ON HERE I hate object oriented programming language
BLUEPRINT PRINT
 ATTRIBUTE TO_PRINT DEFAULT "DEFAULT MESSAGE"
 METHOD PRINT_TEXT
  DISPLAY HAS "\"" AND TEXT AND "\""
 METHOD END
BLUEPRINT END

OBJECT PRINTER IS PRINT
ATTRIBUTE TO_PRINT FROM PRINTER IS "NEW MESSAGE"
PRINTER DO PRINT_TEXT

Using a function:

FUNCTION HI
 VARIABLE (GET) TIMES
 CHECKPOINT LOOP
  TIMES IS TIMES - 1
  DISPLAY HAS "HI"
 JUMP NOT IF ZERO TIMES TO LOOP
FUNCTION END
HI(5)

Truth machine:

VARIABLE INPUT IS $INPUT("NUMBER")
DISPLAY HAS INPUT
JUMP IF EQUALS INPUT WITH 1 TO LOOP
CODE END
CHECKPOINT LOOP
 DISPLAY HAS INPUT
JUMP TO LOOP

Importing files:

the first file:
CODE IS SMART
CODE IS PRINCIPAL
CODE HAS NAME "HELLO WORLD"
CODE HAS FRIEND "PRINT_DOT.CIS"
PRINT_DOT()
the second file (print_dot.cis):
CODE IS SMART
FUNCTION PRINT_DOT
 DISPLAY HAS "."
FUNCTION END