GitHub - remikeat/stackl

3 min read Original article ↗

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

3 stars 0 forks Branches Tags Activity

Notifications You must be signed in to change notification settings

Repository files navigation

Stackl

This is a stack machine based language

It is the ocaml version of https://github.com/msakuta/rustack

You can try it online at https://stackl.remikeat.com/

Results

koch

The image above was produced by below script

/koch {
    /level exch def
    /scale exch def

    { level 5 < }
    {
        save
        scale 3. div level 1 + koch
        scale 100 * 0 translate
        pi -3. div rotate
        scale 3. div level 1 + koch
        scale 100 * 0 translate
        pi 2. * 3. div rotate
        scale 3. div level 1 + koch
        scale 100 * 0 translate
        pi -3. div rotate
        scale 3. div level 1 + koch
        restore
    }
    {
        begin_path
        0 0 move_to
        scale 300 * 0 line_to
        stroke
    }
    if
} def
10 300 translate
2. 1 koch

How to build

dune build stackl.exe

or

make

How to run

cat scripts/koch.sl | ./_build/default/stackl.exe

How to quit

Press q

About

No description, website, or topics provided.

Resources

Readme

Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks

Releases

No releases published

Packages

No packages published