programmingMS 2012
Shodor > SUCCEED > Workshops > Archive > programmingMS 2012

Today in Programming Concepts, Kyle discussed and reviewed the class' knowledge of code and quizzed them by asking how to make a conditional statement that changes text color if the background color is too dark. Then, the group was introduced to Canvas in HTML. Canvas is the part of HTML that allows a programmer to be artistic, to place shapes or lines within code, and really expands the possibilities of HTML for web programming. Kyle talked with the students about positioning and using the correct syntax with the Canvas element to ensure it worked correctly. The class was tasked with changing the color of rectangles that randomly appeared on the Canvas. Kyle wanted them to make each rectangle alternate between three random colors. The students had to look through the starter code and find the individual lines to change, as well as find the appropriate method of changing them. Next, Kyle showed the class as a whole how to use the appropriate code that would perfectly execute the color changing idea he had intended. After watching Kyle work through the example, the students split into pairs of programmers and began debugging their own code to match Kyle's.

After a short break each individual student had the chance to work at their own pace to make the same colored rectangle move randomly on the Canvas. The students learned how to erase or more accurately put a white rectangle on top of the other rectangle. After completing their final project, everyone had their chance to ask any last questions before saying goodbye to Kyle and the workshop. The students completed a lot of activities, developed new skills, and left excited to continue with programming on their own.