Visit http://cmaes.github.io/logoturtle/
See this page for sample programs and their graphical output.
The following directions describe how to install the dependencies for running the code locally.
Use the Real World OCAML installation instructions https://github.com/realworldocaml/book/wiki/Installation-Instructions
$ sudo add-apt-repository ppa:avsm/ppa
$ sudo apt-get update
$ sudo apt-get install curl build-essential m4 ocaml opam
Then do
opam init
eval `opam config env`
Install Homebrew http://brew.sh.
brew install ocaml
brew install opam
Then do
opam init
eval `opam config env`
opam install ocamlfind
https://github.com/Chris00/ocaml-cairo
opam install cairo2
opam install core
opam install menhir
opam install lwt
opam install js_of_ocaml
opam install js_of_ocaml-camlp4
There are two different builds of the interperter:
-
A interpreter that runs from the command-line and uses Cairo as backend to output .png files from Logo programs
-
A interpreter that runs from Javascript and uses a Canvas backend to output graphics from Logo programs in the browser
Issuing the following command to build both.
make
will build and run a program called logo.native
. It creates
a file named tree.png
that should contain a tree.
To clean up do
make clean
Issuing the following command
make logoweb.js
will build a Javascript library containing the interpreter. The file
index.html
shows how this library may be used from Javascript via
the interpetLOGO
command.
I made my own up. But there is one here