direction - edggy/ComputerCraft GitHub Wiki
#Direction
Represents a relative or absolute direction
Name | Return | Description |
---|---|---|
direction(str) | Direction | Accepts the case-insensitive strings |
direction(vec, [absolute]) | Direction | Accepts vectors |
direction.opposite(self) | Direction | Returns the opposite direction. |
direction.absolute(self) | Direction | Returns the absolute direction. |
direction.relative(self) | Direction | Returns the relative direction. |
direction.vector(self, [absolute]) | Vector | Returns a vector representing the direction. |
The table below assumes the turtle is facing east
Input | Relative | Absolute | Opposite | Vector |
---|---|---|---|---|
Forward |
Forward |
East |
Back |
(1,0,0) |
Back |
Back |
West |
Forward |
(-1,0,0) |
Right |
Right |
South |
Left |
(0,0,1) |
Left |
Left |
North |
Right |
(0,0,-1) |
Top |
Top |
Up |
Bottom |
(0,1,0) |
Bottom |
Bottom |
Down |
Top |
(0,-1,0) |
East |
Forward |
East |
West |
(1,0,0) |
West |
Back |
West |
East |
(-1,0,0) |
South |
Right |
South |
North |
(0,0,1) |
North |
Left |
North |
South |
(0,0,-1) |
Up |
Top |
Up |
Down |
(0,1,0) |
Down |
Bottom |
Down |
Up |
(0,-1,0) |
Here |
Here |
Here |
Here |
(0,0,0) |
There |
Forward |
East |
Back |
(1,0,0) |