powered by
Turn the Turtle in the given direction by the given angle.
turtle_turn(angle, direction = c("left", "right"))turtle_left(angle)turtle_right(angle)
turtle_left(angle)
turtle_right(angle)
single numeric value; rotation angle in degrees. A negative value turns the Turtle in the opposite direction than the given one.
character string; direction of the turn. Possible values are "left" and "right".
"left"
"right"
The Turtle must be initialized prior to using this function, see turtle_init.
turtle_init
Other TurtleGraphics: TurtleGraphics-package, turtle_do, turtle_getpos, turtle_goto, turtle_init, turtle_move, turtle_param, turtle_reset, turtle_show, turtle_status, turtle_up
TurtleGraphics-package
turtle_do
turtle_getpos
turtle_goto
turtle_move
turtle_param
turtle_reset
turtle_show
turtle_status
turtle_up
# NOT RUN { turtle_init() turtle_left(30) # equivalent to turtle_turn(30, "left") turtle_right(40) turtle_turn(30, sample(c("left", "right"), 1)) # random turn # }
Run the code above in your browser using DataLab