Cat (Language)

From Esolang
Jump to navigation Jump to search
Not to be confused with Cat Program (language).
For the concatenative language, see catlangwiki:Cat.

Cat is a programming language that does cats

Cat program

cat

Quine program

meow self

Hello world program

meow "hello world"

Counter program

eat 1
do for ever
  meow eat
  eat 1
note: code not ran does not have error checking
note: ever == infinity

Add program

new cat is cat1
new cat is cat2
new cat is cat3
cat1: eat input
cat2: eat input
cat3: eat cat1
cat3: eat cat2
cat3: meow eat

Double program

eat input
eat eat
meow eat

Subtract one program

eat input
throw up 1
meow eat

Error program

new cat is cat1
new cat is cat2
cat1: eat 1
cat2: eat cat1
cat1: meow "is an error"

New eats program

new eat is eat1
eat 1
eat1 2
meow eat
meow eat1

New news program

new new is new1
new1 cat is cat1
cat1:new1: meow "hello"
new cat is cat1
cat1: meow "hi"

New meows program

new meow is meow1
meow "hi"
meow1 "hello"

New references program

new : is ::
new cat is cat1
cat1: meow "yeah"
cat1:: meow "huh"

Variables program

new cat is a
new cat is b
a: eat 5
b: eat 500
new cat is c
c: eat a
c: eat b
eat c
meow eat

Die program

meow "this is my last line of existence"
die cat
note: when a cat dies, it stops the program, and the lines after that dont get error checks
note: cat is the default cat

Revive program

meow "ahh"
die cat
meow "you cant hear this"
revive cat
meow "yay"

Cage program

new cat is cat1
new cat is cat2
new cat is cat3
cage has:
  cat1
  cat2
  cat3
meow cage
die cat
note: cages are like lists

Index program

new cat is cat1
new cat is cat2
cage has:
  cat1
  cat2
take first out of cage
meow taken
die cat
note: i dont like the die command
note: when you print a cat/meow a cat
note: it prints what it ate

Sleep program

meow "ima tired"
sleep cat
note: just an alternative to die, only goes with wake up

Wake up program

sleep cat
wake up cat

Toy program

new toy is "make [a2] as type [a1] (as a structure for [a3])?" as new
make cat1 as type cat
cat1: meow "yay new structures"
sleep cat
note: toys make structures for premade stuff, they dont make functions

Alternative to die but not sleep program

new toy is "go away [a1]" as die
new cat is cat1
go away cat1
go away cat
note: the a1 refers to first input, the a2 refers to the second input, the...

Park program

new park is print
print [a1]:
  meow [a1]
new cat is cat1
cat1: print "new functions yay"
sleep cat
note: this does create functions, all the a1...ainfinity stuff is the same, put [some input]([code]) if you want code
note: to run if and only if the input is given

Clean and Dirty program

dirty cat
clean cat
sleep cat
note: if a cat is dirty, it wont do commands in clean stuff, but if it is clean, it wont do commands in dirty stuff

Clean and Dirty but two program

dirty cat
dirty:
  meow "I AM DIRTY"
clean:
  meow "i am clean"

Input clean and dirty program

clean cat input
sleep cat
note: if the input is 1, the cat gets clean, else it gets dirty

Truth program

clean cat input
clean:
  do for ever:
    meow "1"
dirty:
  meow "0"