Super Yellow

From Esolang
Jump to navigation Jump to search
Super Yellow
Designed by LTHCTheMaster
Appeared in 2023
Memory system variables
Dimensions One-dimensional languages
Computational class Unknown
Reference implementation Super Yellow
File extension(s) .redgreen

Super Yellow was originally made with the goal to use only color names as instructions.

Code's specificity

  • The code is case sensitive
  • All errors are ignored
  • When a line doesn't start with an instruction or contain an error, you can consider it as a comment at your own risks

Variable Types

Name Description Default Value (code writing equivalent) Default Value (human readable) Default Value (displayed on screen using black)
integer This type is used to store positive integer numbers zero 0 0
boolean This type is used to store booleans zero false zero
string This type is used to store strings zero ""
stack This type is a stack in wich you can put everything except stack empty, [] (Python equivalent but using a list) empty

Commands

Command Description Syntax
red Create or modify an integer, Warning: it can change the type of the variable red <name> [value]
green Create or modify a boolean, Warning: it can change the type of the variable green <name> [value]
blue Create or modify a string, Warning: it can change the type of the variable blue <name> [value]
teal copy the value of a variable into another variable, it can create new variables like red, green, blue, you can't copy stack teal <variable> <source variable>
black display a message or the value of a variable black [<message> or #<variable name>]
white ask the user to enter a value white <variable name> [<message> or #<variable name>]
ultraviolet display a new line ultraviolet
infrared do a carriage return infrared
bronze bronze a b do a = a - b bronze <variable name> <variable name>
silver silver a b do a = a + b silver <variable name> <variable name>
gold gold a b do a = a * b, if a is a string and b an integer: do a = a + a + ... + a (b times) gold <variable name> <variable name>
purple purple a b do a = a // b (Python equivalent) purple <variable name> <variable name>
russet russet a b do a = a % b russet <variable name>
orange orange a do a = !a (logical not) orange <variable name> <variable name>
pink pink a b do a = a & b (logical and) pink <variable name> <variable name>
brown brown a b do a = a or b (logical or) brown <variable name> <variable name>
fuscia fuscia a b do a = a xor b (logical xor) fuscia <variable name> <variable name>
yellow goto the specified line (start counting line from 1), if you use 0 as line number, it will jump to the index written on the top of something internally called index_stack and remove this index from this stack, it's usefull to create some sort of functions yellow <line number>
magenta goto the specified line if a == b (start counting line from 1), if you use 0 as line number, it will jump to the index written on the top of something internally called index_stack and remove this index from this stack, it's usefull to create some sort of functions magenta <variable name> <variable name> <line number>
cyan goto the specified line if a != b (start counting line from 1), if you use 0 as line number, it will jump to the index written on the top of something internally called index_stack and remove this index from this stack, it's usefull to create some sort of functions cyan <variable name> <variable name> <line number>
gray goto the specified line if a > b (start counting line from 1), if you use 0 as line number, it will jump to the index written on the top of something internally called index_stack and remove this index from this stack, it's usefull to create some sort of functions gray <variable name> <variable name> <line number>
grey goto the specified line if a < b (start counting line from 1), if you use 0 as line number, it will jump to the index written on the top of something internally called index_stack and remove this index from this stack, it's usefull to create some sort of functions grey <variable name> <variable name> <line number>
azure create a stack or add a value above the stack, you can't put a stack in another stack azure <name> [<source variable name>]
crimson remove the first item on the top of the stack, you can get and store this item in a variable crimson <stack variable name> [<variable name>]
vermilion goto the specified line if the specified stack is empty (start counting line from 1), if you use 0 as line number, it will jump to the index written on the top of something internally called index_stack and remove this index from this stack, it's usefull to create some sort of functions vermilion <stack variable name> <line number>
lime push on the top of something internally called index_stack the index of the current line + 2 lime
khaki set the value of a string to the reverse value of this string khaki variable name
indigo split string in two parts, it can create new variables like blue indigo <variable name> <variable name>
sepia use an integer as a code to put the corresponding char in the variable sepia <variable name>
lavender convert a char to the corresponding unicode code and put this code in the variable lavender <variable name>
beige ask the user to enter a value, the variable receive only the first char of the user input beige <variable name> [<message> or #<variable name>]
mint ask the user to enter a value, the variable receive only the last char of the user input mint <variable name> [<message> or #<variable name>]

Some More Details

  • if you use crimson on an empty stack and store the value, you will get the following value in your variable: \#$µ%¤\@^
  • black one|zero is equivalent to ultraviolet
  • black one|three is equivalent to infrared

Equivalent line speedtest

Command 1 Time (in seconds) Command 2 Time (in seconds) Number of lines tested in a file with only this line "Timestamp" of the test report in this table just after the test (using datetime (Python))
black one|zero 24.926881790161133 ultraviolet 20.20875382423401 60000 2023-11-13 15:19:49.643338
black one|three 9.278607845306396 infrared 7.548259973526001 60000 2023-11-13 15:26:11.542389

Value Writing

when you see value in the commands list above check the details below:

  • if the variable is a boolean write one if you want true or anything else for false
  • if the variable is an integer write each digit in their word form and put a | between each word, for example: 854 <=> eight|five|four, 37 <=> three|seven
  • if the variable is a string: all wanted characters are separated with one space character, each character is written its decimal unicode written like integer values for integer variables, for example: o <=> one|one|one, bottle <=> three|two nine|eight one|one|one one|one|six one|one|six one|zero|eight one|zero|one

when you see message in the commands list above, consider writing the value for a string variable

Examples

Popular problem

Hello World!

black seven|two one|zero|one one|zero|eight one|zero|eight one|one|one four|four three|two one|one|nine one|one|one one|one|four one|zero|eight one|zero|zero three|three

Truth Machine

red truth
red 1 one
red 0 zero
white truth
magenta truth 1 8
magenta truth 0 10
yellow 11
black #truth
yellow 8
black #truth

Cat program

blue cat
white cat
black #cat

Looping Counter

blue out four|two
teal * out
black #out
silver out *
ultraviolet
yellow 3

Infinite Loop

yellow 1

Fibonacci sequence

red a zero
red b one
black #a
ultraviolet
black #b
ultraviolet
silver a b
silver b a
yellow 3

Factorial

red to_fac
red 1 one
red 0 zero
white to_fac
teal out to_fac
teal mem to_fac
magenta to_fac 0 13
magenta to_fac 1 14
bronze to_fac 1
magenta to_fac 1 14
gold out to_fac
yellow 9
silver out 1
black #mem
black three|three three|two six|one three|two
black #out

99 bottles of beer

red counter nine|nine
red 2 two
red 1 one
red 0 zero
blue no seven|eight one|one|one
blue bottle three|two nine|eight one|one|one one|one|six one|one|six one|zero|eight one|zero|one
blue s one|one|five
blue of_beer three|two one|one|one one|zero|two three|two nine|eight one|zero|one one|zero|one one|one|four
blue on_the_wall three|two one|one|one one|one|zero three|two one|one|six one|zero|four one|zero|one three|two one|one|nine nine|seven one|zero|eight one|zero|eight
blue , four|four
blue . four|six
teal on_the_wall_2 on_the_wall
silver on_the_wall ,
silver on_the_wall_2 .
teal of_beer_on_the_wall of_beer
silver of_beer_on_the_wall on_the_wall
teal of_beer_on_the_wall_2 of_beer
silver of_beer_on_the_wall_2 on_the_wall_2
blue take_one_down_pass_it_around eight|four nine|seven one|zero|seven one|zero|one three|two one|one|one one|one|zero one|zero|one three|two one|zero|zero one|one|one one|one|nine one|one|zero four|four three|two one|one|two nine|seven one|one|five one|one|five three|two one|zero|five one|one|six three|two nine|seven one|one|four one|one|one one|one|seven one|one|zero one|zero|zero four|four
black #counter
black #bottle
grey counter 2 24
black #s
black #of_beer_on_the_wall
ultraviolet
black #counter
black #bottle
grey counter 2 30
black #s
black #of_beer
black #.
ultraviolet
black #take_one_down_pass_it_around
ultraviolet
bronze counter 1
grey counter 1 39
black #counter
yellow 40
black #no
black #bottle
magenta counter 1 43
black #s
black #of_beer_on_the_wall_2
ultraviolet
ultraviolet
magenta counter 0 48
yellow 20

Some other examples programs

Simple counting program

red out zero
red 1 one
black three|two three|two
black #out
silver out 1
infrared
yellow 3

Reverse the order of a stack

red counter
red 1 one
red max one|zero
azure normal
azure reversed
red tmp

azure normal counter
silver counter 1
azure normal counter
cyan counter max 9

black #normal
ultraviolet

crimson normal tmp
azure reversed tmp
vermilion normal 20
yellow 16
black #reversed

A test of a sort of PEEK operation for stack

red counter
red 1 one
red max one|zero
azure stack
red tmp

azure stack counter
silver counter 1
azure stack counter
cyan counter max 8

yellow 18

crimson stack tmp
azure stack tmp
yellow 0

lime
yellow 14
black #stack
ultraviolet
black #tmp
ultraviolet
crimson stack
vermilion stack 27
yellow 18
black seven|zero one|zero|five one|one|zero one|zero|five one|one|five one|zero|four three|three

Sort a stack

Ask the user to choose the size of the stack and input values in this stack, show the original stack and the sorted stack

black seven|two one|one|one one|one|nine three|two one|zero|nine nine|seven one|one|zero one|two|one three|two one|one|zero one|one|seven one|zero|nine nine|eight one|zero|one one|one|four one|one|five three|two six|three one|zero
red max
white max
ultraviolet
red 1 one
red counter
red input
azure orig_stack

silver counter 1
white input
azure orig_stack input
cyan counter max 10
black #orig_stack

azure helper_stack
red element
red tmp
red tmp2

vermilion orig_stack 34
crimson orig_stack element
vermilion helper_stack 31
lime
yellow 39
magenta tmp element 31
gray tmp element 31
crimson helper_stack tmp2
azure orig_stack tmp2
yellow 23
azure helper_stack element
yellow 21

crimson helper_stack tmp
azure orig_stack tmp
vermilion helper_stack 43
yellow 34

crimson helper_stack tmp
azure helper_stack tmp
yellow 0

ultraviolet
black #orig_stack

Length of a string

Ask the user to enter a text and calculate the length of this text

black six|nine one|one|zero one|one|six one|zero|one one|one|four three|two one|one|five one|one|one one|zero|nine one|zero|one one|one|six one|zero|four one|zero|five one|one|zero one|zero|three five|eight one|zero
blue user_input
white user_input
blue default
teal copy_of_user_input user_input
red length
red 1 one

magenta copy_of_user_input default 27
silver length 1
lime
yellow 16
teal copy_of_user_input splitted_copy
yellow 9

teal instr copy_of_user_input
indigo instr splitted
teal splitted_copy splitted
magenta splitted default 25
indigo instr splitted
teal tmp splitted
silver tmp splitted_copy
teal splitted_copy tmp
yellow 19
yellow 0

ultraviolet
black one|zero|eight one|zero|one one|one|zero one|zero|three one|one|six one|zero|four three|two one|one|one one|zero|two five|eight three|two
black #user_input
black three|two six|one three|two
black #length

0 to z

display all characters from 0 to z

red current four|eight
red max one|two|two
red 1 one
gray current max 10
sepia current
black #current
lavender current
silver current 1
yellow 4

A Simple Brainfuck Interpreter

Brainfuck interpreter in Super Yellow inspired by brainfuck Python interpreter