Wednesday, June 17, 2015

Drawing, While and Music (5th and 6th Grade Programming)

Who: Baan PathomTham 5th and 6th grades
Where: at school
When: Monday morning

Fifth Grade

Questions and observations from the homework
This week, the students had noticed two things. First, though everyone was asked to draw a triangle as part of the homework, all the versions were different. They've seen this before, but I really like to emphasize that there is no single right answer.

Second, Jung had been playing with message program from the homework and noticed: "it doesn't do anything!" We talked about what they expected would happen (it would write "Hello you" twice). Then I showed them the test panel, where the output from see gets displayed. For some reason, this panel is often closed, so it wasn't surprising that Jung didn't see any output. However, now, they got a surprise because the output still wasn't what they expected. That led us to talk about literal strings and variables and then do an example with write instead of see.

Challenge 1: A map puzzle
For our first challenge of the day, we used a program that Chunly wrote:

My question: can they make this same picture, but without the purple tail on the green dot?
Everyone completed this challenge, but, given the many ways to move the turtle and to draw something, they all had different approaches:

  1. Movement: adjust the purple line from the start, jump back to the origin, use home() to get back, or retrace the path the turtle had originally followed
  2. Drawing: draw a new dot, draw green over the dot, start drawing the purple line only at the edge of the green dot

This simple example got us to experiment with several new commands: home(), pu(), pd(). Again, it reinforced the message that there are many paths to the target destination.


Challenge 2: A plum triangle
For the second challenge, we used Pitchee's triangle from the homework. She had created an isosceles right triangle through trial and error on the hypotenuse length:

For this challenge, we added scale 10 at the start of the program (to make all the drawing elements gigantic) and ht() at the end so that the turtle wouldn't block our view. Following this, we started discussing:
What did we notice? Why was it like that? What could we do to fix it? Is this a bug or a feature?
This is something we will continue next class.

Homework
For this week, the homework is to test out the code on the right side of this page:

Sixth Grade

While we make music
Last week, students noticed the play command. I wanted to build on this by giving them more examples of ABC notation,  but I also wanted to review while and logic keywords if, and, or. In retrospect, this idea was too ambitious for one class.

Through a series of stages, I wanted them to think about how many times each line of music got played based on when and how often the conditions in the if statements were true. This was actually hard to tell and it would have been better to give them visual signals instead (or in addition).

I think we will have to return to these key words again next week. We will also discuss the guessing game that we've been writing.

Projects begin
Last week, the kids submitted outlines for their term projects. These are the ideas:

  • Boongie: a clue-and-guess game where the computer plays different animal sounds and then the player enters the name of the animal.
  • Win: a driving game where we control a car that drives along a path avoiding obstacles. The screen mechanism he wants is  to keep the car fixed vertically and have the path scroll down.
  • Gan: a chasing game where we try to move around the screen collecting point-objects while avoiding bombs and keeping away from an enemy turtle who is chasing us. 
  • Titus: a version of space invaders.

Homework
The homework for each depends on their project:




  • Boongie: Find sound files for as many animal sounds as he can locate
  • Win: work on how to control the car's left-right position with the mouse, while keeping the vertical position fixed.
  • Gan: he had found a program that did many of the things he wants in his game. One homework element is to go through that code and come up with questions about thins he doesn't understand. The second component is to figure out how to create point-objects to appear randomly on the screen.
  • Titus: Create a sprite that can shoot lasers. 

1 comment:

  1. I forgot to mention that there was also a question about the bulls-eye code: was "x" the symbol for multiplication or something else? We talked about how, in math, there are several ways to show multiplication, but in our code, we can only represent it one way: with a "*"

    ReplyDelete