Figure 1. You should see something like this.
As we discussed in class, advanced software engineering uses stick-people to model actors in “use case scenarios”. You can learn more looking for Universal Modeling Language. We want to draw one or more stick-people with the following function
Figure 2. You can also draw something like this.
<- function(size) {
draw_person draw_head(size*1.2)
turtle_left(180)
turtle_forward(size)
turtle_left(90)
draw_arm(size*1.5)
turtle_left(180)
draw_arm(size*1.5)
turtle_left(90)
turtle_forward(size*2)
turtle_left(20)
draw_leg(size*2)
turtle_right(40)
draw_leg(size*2)
}
Your task is to write the functions draw_head()
,
draw_arm()
and draw_leg()
. They should look
like Figure 1, but you can make creative modifications, like hands with
fingers, hair, etc.
The most important issue is that each of your functions must leave the turtle in the same position and the same angle as before. Your function can move the turtle as you wish, but it must leave the turtle as it was at the beginning of the function.
Delivery
Please send me the homework-3.R
file in an email to
andres.aravena+cmb@istanbul.edu.tr.
Do not forget to write your name and number.