Codeglass

From Esolang
Jump to navigation Jump to search

Codeglass is an esolang where all variables measure the run time of the program (you can reset them though)

(note: all variables start at 0 and do not increase until reset (apart from #() that starts by runing))

(note: no numbers can be used inside the code)

(note: #(0)=#())

What symbols mean what:

@(x) reset variable number x
#(x) the value of varible number x
[expr|code] run code while expr (x<y,x>y,x=y,x<=y or x>=y)
$(x) print x as ASCII character 
% ask the user for a character and use that as a number (ASCII -> num)

optional:

* NOP
?(code) 50-50 chance of running code

all variables increase by 1 each action

Actions:

executing @(x)
checking the conditional in [expr|code]
executing $(x)
asking for user input (%)
executing *
executing ?(code)

(note: changes are counted after the action is taken except in the case of @(x) where it is counted before)

Programs

Hello world!

there is probably a faster way to do this but...

***...(104 *s here)$(#())@()***...(101 *s here)$(#())******$(#())@(#())***...(108 *s here)$(#())**$(#())@()***...(32 *s here)
$(#())***...(86 *s here)$(#())@()***...(111 *s here)$(#())**$(#())@()***...(108 *s here)$(#())@()***...(100 *s here)$(#())@()***...(33 *s here)$(#())