SUCCEED

   

programmingHS 2013
Shodor > SUCCEED > Workshops > Archive > programmingHS 2013

For the third day of the programming workshop, students started off with a review of the previous day which was led by Aaron. The review covered arithmetic operators such as multiplication, division, and modulus (dividing with remainder). It also included a discussion on logical operators, such as "and" which can be used to determine if one condition and a second condition are both met.

After the quick review, Phil introduced the concept of loops. His lesson included how they are created, what determines the number of times a loop runs, and various cases which might cause an infinite loop. He also introduced the idea of scope and discussed how, in some languages, variables initialized inside a loop are not accessible outside of it. To reinforce the concepts in the lesson, Phil gave the students a project involving the html canvas. By creating and editing a couple for loops, the students were able to edit a simple game of pong.

Megha followed up Phil's lesson with an introduction to functions. Her lesson included an explanation of the function keyword, how to create and call functions, and how to pass arguments to them and return a value. She then gave the students an exercise to allow them to practice creating functions.

At the end of the day, the students were given a larger project which involved both loops and functions. Students were able to edit both to create and modify a grid of colored squares on a canvas.