TurtleGraphics - Online Manual

turtle_do {TurtleGraphics}R Documentation

Evaluate a Larger Portion of Turtle Drawing Code

Description

turtle_do evaluates an R expression with the Turtle temporarily hidden (for performance reasons).

Usage

turtle_do(expr)

Arguments

expr

expression to evaluate

Details

The terrarium must be initialized prior to using these functions, see turtle_init.

In order to decrease the evaluation time of expr, it is evaluated with Turtle temporarily hidden. Basically it means that if a Turtle image is visible (see turtle_show and turtle_hide) turtle_do removes it, evaluates expr and redraws it on the function exit.

See Also

Other TurtleGraphics: TurtleGraphics-package; turtle_backward, turtle_forward, turtle_move; turtle_col, turtle_lty, turtle_lwd, turtle_param; turtle_down, turtle_up; turtle_getangle, turtle_getpos; turtle_goto, turtle_setangle, turtle_setpos; turtle_hide, turtle_show; turtle_init; turtle_left, turtle_right, turtle_turn; turtle_reset; turtle_status

Examples

turtle_init()
turtle_do({
   for (i in 1:4) {
      turtle_forward(50)
      turtle_right(90)
   }
})

[Package TurtleGraphics version 1.0-5 Index]