SUCCEED

   

programmingHS 2012
Shodor > SUCCEED > Workshops > Archive > programmingHS 2012

Doug started today's lesson by introducing the concept of generating random numbers. To implement this concept he had the class work together to create a dice rolling game. By giving each group a segment of starter code, Doug challenged the class to think about ways they could approach a problem: rolling the die and adding 1 to the random number generated. Once the groups had a chance to work on their own, Doug brought them back together and walked the class through the process of adding numbers to their corresponding clicker variables based on the generated number. Then the class broke up in to pairs again to figure out how to print a dot for each number of times the die was rolled to a number. After Doug has inspected the class' progress, they took their break.

Once the break was over, the class learned about hexadecimal color values and how to convert from regular base 10 numbers to base 16 hexadecimal numbers. After learning this, the students started on their next project of generating random colors to display in divs. The kids were very engaged in this project and were eager to use the colors on their divs. Then Doug taught them how to change their text color to white if the background color is dark enough, a fun graphical tool! The last concept that class worked with was a way to add a time to their page. This time was used to change the colors, one-by-one, every second.