Skip to content

Interpreter for the ~ath programming language from homestuck

License

Notifications You must be signed in to change notification settings

PaulkaToast/tilde-ath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tilde-ath

build status Coverage Status

Interpreter for the ~ATH programming language from homestuck

Installation Instructions

pip install -r requirements.txt

Testing Instructions

python -m pytest

// with coverage
python -m pytest -v --cov ath --cov-report term-missing

Examples

Printing

C

printf("hello, world!\n");

~ATH

> hello, world!\n ==> ;

Variable Declaration

C

int var = 5;
string var = "hello";

~ATH

var = 5;
var = >hello=;

Function Declaration

C

int func() {
	return 0;
}

~ATH

ACT func() {
	APPEARIFY 0;
}

Arithmetic Operators

C

x = a + b;
x = a - b;
x = a * b;
x = a / b;
x = a % b;

~ATH

x = ADDIFY(a,b);
x = SUBIFY(a,b);
x = REPLICATE(a,b);
x = DIMINISH(a,b);
x = RESIDUE(a,b);

Relational Operators

C

x = a == b;
x = a != b;
x = a > b;
x = a < b;
x = a >= b;
x = a <= b;

~ATH

x = a == b;
x = a != b;
x = a > b;
x = a < b;
x = a >= b;
x = a <= b;

Logical Operators

C

x = a && b;
x = a || b;
x = !x; 

~ATH

x = a && b;
x = a || b;
x = !x;

Loops

C

for( ; ; ) {
      printf("This loop will run forever.\n");
}

~ATH

u1 = ALIVE;
u1.lifespan = HE_IS_ALREADY_HERE;

~ATH(u1) {
	> This loop will run forever.\n ==> ;
}EXECUTE(NULL);

python

for x in range(0, 3):
	print("counter is:" + str(x))

~ATH

u1 = ALIVE;
u1.lifespan = 3;
u1.age = 0;

~ATH(u1) {
	>counter is:$(u1.age) ==> ;
}EXECUTE(NULL);
THIS.DIE();

If Statements

python

if x < 50:
	//code

~ATH

u1 = ALIVE;
u1.DIE_UNLESS(x < 50);

~ATH(u1) {
       	//code
	U1.DIE();
}EXECUTE(NULL);
THIS.DIE();

python

u1 = true

if u1:
	//code
else:
	//code2

~ATH

u1 = ALIVE;
u1.lifespan = HE_IS_ALREADY_HERE;
u1.age = 0;

~ATH(u1) {
	//code
	u1.DIE();
}EXECUTE(u1.REVIVE());
~ATH(!u1) {
	//code2
	u1.REVIVE());
}EXECUTE(u1.DIE());
THIS.DIE();

About

Interpreter for the ~ath programming language from homestuck

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages