Control turtleSpaces from other applications with its API

You can communicate with turtleSpaces over a socket (telnet) connection to port 1967.

First you need to issue the API command inside of turtleSpaces to enable API connections, or use the -enable-api flag when starting up.

Then connect to turtleSpaces from an external application or terminal. You can issue instructions to affect turtles and the environment just like you would do inside the turtleSpaces application.

The API connection executes as its own worker. You can also redirect input and output to the API instance by using setread “api and setwrite “api – but these must be issued by the API worker itself to redirect to that worker (if you use another API connection, reading and writing will be redirected to that API instance, for example).

Using the API, you can use turtleSpaces as a visualiser for another application, and have it act as a light organ, or create charts and graphs.