Cat

From Esolang
Jump to navigation Jump to search

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

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