Sunday, November 9, 2014

Creating new creatures (Programming Class 8)

who: Baan Pathomtham Grade 5
when: Monday morning, bright and early
where: at school



Sharing our Work
First, we looked at programs we have written:

  1. Birthday animation for an uncle
  2. Win's flower
  3. Spirals: Boongie and Titus.  Remember, this was the inspiration: popSpiral.
For the spirals, we discussed briefly differences in how these were implemented and then flagged the key similarity of the nested loop.

Nested For Loops
What does this code create?

speed 50
for x in [0..200] by 25
  for y in [0..200] by 25
    moveto x, y
    dot 10, rgb(x, y, 0)
ht()

This is going to come back next week when Pooh is leading the class and there will be some other examples of nested for loops.

Creating a new creature
Another block of code for experimenting.  The kids played with this and then started trying to build their own versions with spooky ghosts:

ant = new Sprite
  color: transparent #can use other colors or 
#  width: 500
#  height:50
  
drawon ant
turtle.speed 100
fd 9
pen black
lt 60, 15
lt -60, 15
rt 60, 15
rt -60, 15
lt 75
fd 10
bk 10
rt 150
fd 10
bk 10
lt 75
pu()

dot crimson, 10
bk 9
pd()
lt 90
fd 10
bk 20
fd 10
rt 90
pu()
dot crimson, 8
bk 10
pd()
rt 75
bk 10
fd 10
lt 150
bk 10
fd 10
rt 75
pu()
dot crimson, 12

# sync makes the ant wait until
# the turtle is done.

drawon() sync ant, turtle

ant.pen orange
for [1..5]
  ant.fd 100
  ant.rt 100

Homework
(1) look at the program antGamer (http://jgplay.pencilcode.net/edit/class/antGamer) and try to figure out what it does.  What can you change?
(2) work on your ghost programs

Feedback
Two points I thought were worth flagging from the feedback cards this week:
(1) when asked what they learned, the kids still generally talk about the whole program, not the underlying concept.  This makes me concerned that they don't see the more general idea and won't think of using it when it is appropriate.  Based on this, we are going to spend a bit more time next week talking about how the programs work.

(2) I love this other answer to what I learned: "I learned that there are things I don't know yet."

No comments:

Post a Comment