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

Today the students had a special treat as both Doug and Kyle taught in tandem. First, the workshop students continued their work with creating random numbers between 1 and 6. It was imperative that the students mastered the ability to create this value as they transitioned into creating a dice-rolling game. The objective of this code was to familiarize students with using loops and an array to store the results of their random dice rolls. They also used a function that creates random numbers by using JavaScript's built-in random number generator.

After a short break, Doug and Kyle discussed how to separate JavaScript from HTML and loading the JavaScript from an external file. Then, the class was given their second project of the day: hexadecimal numbers, created from a random number generator, that could be turned into a hexadecimal color string. Each student used loops to color the background of six distinct lines, also known as divs, in their HTML file. This section of the project introduced them to a method for setting a time delay to ensure only one division was colored at a time. Overall the students' mastery of the concept of divs was impressive and the class was eager to learn more.