Where: at school

when: Monday morning for 2 hours

Reminder, this is our standard lesson plan for the rest of the term:

- New or review concepts: For loops, functions, if statements. Often, this will be integrated with the exercises.
- Exercises related to the projects
- Project work

# New/Review

The new concept today was the**random**function. We played with three snippets of code to understand how this works and, of course, keep practicing for loops:

- Generate 4 random integers between 1 and 10 (inclusive)
- Modify the previous program to multiple your random numbers by 10
- Change the first program to generate numbers in [10, 100]

Using the random function has many applications for games. In the projects this term, I expect that Kan and Boongie will use it to help create new mazes each time the program is run, Win will use it to generate a new set of math questions, and Titus will use it to shuffle the picture cards.

For our review, I wanted to reinforce the ideas related to functions. In one of our last sessions, we realized that the kids didn't really understand function definitions, calls, and variables. This time, i gave them three code snippets:

- Define hypotenuseStep1(a, b) = a+b
- Define hypotenuseStep2(a,b) = a*a + b*b
- Define hypotenuseFinal(a,b) = sqrt(a*a+b*b)

# Project Exercises

As noted above, the exercises on random have several potential applications in the projects. The other exercise today was most directly related to Win's project. We combined for loops, random, and write statements to loop through some math statements.Here are some ideas for future project exercises, particularly using functions:

(1) reset/restart the game

(2) B: draw random gaps in circles for maze

(3) Gan: maybe randomize drawing of maze, depends on how he plans to structure the maze

(4) T: check to see if chosen cards match the next picture symbol

# Projects and homework

The students are all making reasonable progress on their projects. I have stored copies of their work up to the start of today's class in this folder: Project Directory. The homework this week:- Kan: finish drawing his maze. Next module is to decide what penalty he wants when the turtle runs into the wall.
- Boongie. implement the penalty when the turtle runs into the wall, the turtle bounces back to a previous shell in the maze. There are several ways to do this and I'm curious to see his approach.
- Win: create a looping function so that they get a second chance for an incorrect answer. Next module is to think about gradations in how hard the questions are.
- Titus: arrange the memory cards into a grid, randomize each time the game is played, if possible. Next module is to think about how to check to see if the player chooses a match.

## No comments:

## Post a Comment