Skip to content

Implementation of a small language with turtle features in D

Notifications You must be signed in to change notification settings

benrosenberg/durtle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Durtle

Implementation of a small language with turtle features in D.

Uses raylib (via raylib-d) for graphics, and Pegged for parsing.

Durtle is Turing-complete, as it can simulate Langton's Ant (see below for a screenshot matching the Wikipedia article).

Documentation

The language docs are available here: Durtle GitHub wiki

Examples

Sierpinski triangle

`sierpinksi triangle` (~4;[>1^2]_[>1v2]_<*2;{#/2}1,>_.{#/2}1,</2^_.{#/2}1,</2v_.\)1.{g512}1

Cantor set

`cantor set` (~1;>_;v_>_<_{#/3}1>/3{#/3}1^_\)1.{a243}1

Grid

`grid` (~4;.>_v_<_^_,;{#/2}1>/2{#/2}1v/2{#/2}1</2{#/2}1^/2\)1{b128}1

Hilbert curve

`hilbert curve` (~0;_;~a;|1;|3\~a;{r-1}1;{a-1}1\^2~a;|3;|1\~a;{a-1}1;{r-1}1\^2~a;{a-1}1;{r-1}1\~a;|3;|1\^2~a;{r-1}1;{a-1}1\~a;|1;|3\\)1.{a8}1

Dragon curve

`dragon curve` (~0;^2;{a-1}1|1{r-1}2\)1 (~0;^2;{a-1}1|3{r-1}2\)2 .{a12}1

C-curve

`c-curve` (~0;^2;{a-1}1|1{a-1}1|3\)1.{a13}1

Langton's ant

`langton's ant` |2 [! ~w; |3 b ., >1 ; |1 w ., >1 \]11000

About

Implementation of a small language with turtle features in D

Resources

Stars

Watchers

Forks

Languages