February 21, 2018
You can install TurtleGraphics in R with this command
Then you load into the session using
Now you start a new “terrarium” with
Set Up a New, Shiny Terrarium
turtle_init(width = 100, height = 100, mode = c("error", "clip", "cycle"))
We will explore these options later
move (10) steps
turn cw (15) degrees
turn ccw (15) degrees
point in direction (90 v)
go to x:(0) y:(0)
set pen color to (0)
set pen size to (1)
turtle_lty(1)Change line type
Evaluate a Larger Portion of Turtle Drawing Code
x y 50 50
So we have to adapt our code (how?)
Error in .turtle_draw_error(distance, curX, curY, curAng, curGp, curDraw, : The Turtle escaped from the terrarium. :-(
turtle_init(mode = "clip")
Please write in paper what we do on Rstudio
What happens when the turtle gets out?
Since the turtle is at (50,50),
How do we change our code?
Separating a complex problem into smaller, more manageable parts
Here we separate a complex figure into many smaller parts
Homework: Draw a stick man using R Turtle Graphics
Is this problem similar to another?
Are there parts of this problem that are similar to each other?
Please answer this question
Computers can be used to help us solve problems. However, before a problem can be tackled, the problem itself and the ways in which it could be solved need to be understood.
Computational thinking allows us to do this.
Computational thinking allows us to take a complex problem, understand what the problem is and develop possible solutions. We can then present these solutions in a way that a computer, a human, or both, can understand.
They are like legs on a table
Correctly applying all four techniques will help when programming a computer.
A complex problem is one that, at first glance, we don’t know how to solve easily.
Computational thinking involves taking that complex problem and breaking it down into a series of small, more manageable problems (decomposition). Each of these smaller problems can then be looked at individually, considering how similar problems have been solved previously (pattern recognition) and focusing only on the important details, while ignoring irrelevant information (abstraction). Next, simple steps or rules to solve each of the smaller problems can be designed (algorithms).
Finally, these simple steps or rules are used to program a computer to help solve the complex problem in the best way.