Description Usage Arguments Details See Also Examples
Turn the Turtle in the given direction by the given angle.
1 2 3 4 5 | turtle_turn(angle, direction = c("left", "right"))
turtle_left(angle)
turtle_right(angle)
|
angle |
single numeric value; rotation angle in degrees. A negative value turns the Turtle in the opposite direction than the given one. |
direction |
character string; direction of the turn.
Possible values are |
The Turtle must be initialized prior to using
this function, see 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
1 2 3 4 | turtle_init()
turtle_left(30) # equivalent to turtle_turn(30, "left")
turtle_right(40)
turtle_turn(30, sample(c("left", "right"), 1)) # random turn
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.