Description Usage Arguments Details See Also Examples
turtle_forward
moves the Turtle in forward direction and
turtle_backward
moves the Turtle back.
1 2 3 4 5 | turtle_move(distance, direction = c("forward", "backward"))
turtle_forward(distance)
turtle_backward(distance)
|
distance |
single numeric value; specifies the distance to make. Negative distance results in moving in the opposite direction. |
direction |
character string; moving direction.
One of |
The Turtle must be initialized prior to using
these functions, see turtle_init
.
These functions make use of the Turtle's display options specified by
the turtle_param
function
(or if not, use the default options set by turtle_init
).
Note that if turtle_up
or turtle_down
was called, the Turtle's trace will be or not be drawn, respectively.
If you are willing to call these functions in an R loop,
you may want to hide the Turtle temporarily (see turtle_hide
and turtle_do
)
before making actual moves. This will increase the drawing performance
significantly.
Other TurtleGraphics: TurtleGraphics-package
,
turtle_do
, turtle_getpos
,
turtle_goto
, turtle_init
,
turtle_param
, turtle_reset
,
turtle_show
, turtle_status
,
turtle_turn
, turtle_up
1 2 3 4 5 6 7 8 | turtle_init()
turtle_left(30)
turtle_forward(2)
turtle_up()
turtle_forward(1)
turtle_down()
turtle_right(60)
turtle_forward(9)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.