damien/cc-scripts — pull request #7 by eric-wieser (2012-12-15 14:03:24+00:00)
Title: Dead reckoner

I've added an API to monkeypatch the turtle API to hold state. This needs to be done as monkeypatching so that _all_ programs update the internal state, not just the ones written with the API in mind.

It lets you do things like:

```lua
local my_base = vector.new(100, 64, 0)
local my_skybase = vector.new(125, 128, 0)

turtle.position = my_base -- the coords where I placed the turtle
turtle.orientation = direction.north -- the direction I placed it facing

turtle.moveTo(my_skybase)
```

Along with this, I added some programs that can be run straight from the command line:

```
> position
100,64,0
> position 0 0 0
> position
0,0,0
> direction s
> direction
south (-1, 0 0)
```

Not sure how well this fits in with your `t` api...