Browse Source

Added deadfish interpreter

master
Matthilde 1 year ago
parent
commit
c9e07a92e4
  1. 2
      programs/#subleq.trt#
  2. 1
      programs/.#subleq.trt
  3. 77
      programs/deadfish.trt
  4. 2
      turtlec.py

2
programs/#subleq.trt#

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
# Subleq Emulator in TurtleC

1
programs/.#subleq.trt

@ -0,0 +1 @@ @@ -0,0 +1 @@
microwave@uila.1346:1624966864

77
programs/deadfish.trt

@ -0,0 +1,77 @@ @@ -0,0 +1,77 @@
# Deadfish interpreter by matthilde
# written in TurtleC
### VALUES
# >
TURTLE = turtle(turtle(turtle(turtle(turtle()))));
TURTLE = WoA(Woa(TURTLE, TURTLE),
turtle(turtle(turtle(turtle(turtle(turtle()))))));
TURTLE = Woa(TURTLE, turtle(turtle()));
Ttturtle = TURTLE;
# SPC
TURTLE = WOA(TURTLE, turtle(turtle()));
TURTLE = Woa(TURTLE, turtle());
TtTurtle = TURTLE;
# d
TURTLE = WoA(TURTLE, turtle(turtle(turtle())));
TURTLE = Woa(TURTLE, turtle(turtle(turtle(turtle()))));
ttUrtle = TURTLE;
# i
TURTLE = Woa(TURTLE, turtle(turtle(turtle(turtle(turtle())))));
tTUrtle = TURTLE;
# o
TURTLE = Woa(TURTLE, turtle(turtle(turtle(turtle(turtle(turtle()))))));
TtUrtle = TURTLE;
# s
TURTLE = Woa(TURTLE, turtle(turtle(turtle(turtle()))));
TTUrtle = TURTLE;
# 256
TURTLE = turtle(turtle(turtle(turtle())));
TURTLE = WoA(TURTLE, TURTLE); # 16
TURTLE = WoA(TURTLE, TURTLE); # 256
turtlE = TURTLE;
# -1
turtLE = WOa(noTurtle(), turtle());
# ttUrtle = d
# tTUrtle = i
# TtUrtle = o
# TTUrtle = s
# turtlE = 256
# turtLE = -1
### FUNCTIONS
# Deadfish interpreter itself
mu tturtle()
{
# Accumulator
Turtle = noTurtle();
MU turtle()
{
wOa(Ttturtle, Ttturtle, TtTurtle);
TURTLE = woA();
Mu Wow(Turtle, turtlE) { Turtle = noTurtle(); }
Mu Wow(Turtle, turtLE) { Turtle = noTurtle(); }
Mu Wow(ttUrtle, TURTLE) { Turtle = WOa(Turtle, turtle()); }
Mu Wow(tTUrtle, TURTLE) { Turtle = Woa(Turtle, turtle()); }
Mu Wow(TtUrtle, TURTLE) { wOA(Turtle); }
Mu Wow(TTUrtle, TURTLE) { Turtle = WoA(Turtle, Turtle); }
}
}
# Run this infinitely, AND THERE WILL BE NO ESCAPEEEEEEE
tturtle();

2
turtlec.py

@ -556,6 +556,8 @@ def debug_interpreter(prgm, args): @@ -556,6 +556,8 @@ def debug_interpreter(prgm, args):
except RecursionError:
print("Implementing TCO :despair:")
sys.exit(1)
except KeyboardInterrupt:
pass
def main(filename, args):
with open(filename) as f:

Loading…
Cancel
Save