This function creates a new empty plot with the Turtle centered on the board and facing to the north.
turtle_init(width = 100, height = 100, mode = c("error", "clip", "cycle"))
numeric; plot width.
numeric; plot height.
character string; one of "error"
, "clip"
,
or "cycle"
.
The mode
argument determines what happens if the Turtle
tries to move outside the terrarium.
clip
allows it to do that, but the drawing will be clipped
to the predefined plot region.
error
throws an error.
cycle
makes the Turtle appear on the other side of the board.
After the turtle_init()
function has been called
you can e.g. move the Turtle with the turtle_forward
function, turn its direction with turtle_right
or set display parameters of the Turtle's trace,
see turtle_param
.
Other TurtleGraphics: TurtleGraphics-package
,
turtle_do
, turtle_getpos
,
turtle_goto
, turtle_move
,
turtle_param
, turtle_reset
,
turtle_show
, turtle_status
,
turtle_turn
, turtle_up