Showing posts with label Math. Show all posts
Showing posts with label Math. Show all posts

Tuesday, June 16, 2015

Pac-Man is Chasing my Planet!

My child's class was recently introduced to Cartesian coordinates in Math. And in our coding class, we have been practicing interactive programming for the last few weeks. So, I thought of putting together a very simple template that  combines both the concepts, that the kids could then remix...  Pac-Man is Chasing my Planet! was the result... took me less than 10 minutes to put together and the kids loved it.

We went through the Pac-Man template code as a group & discussed the use of the XY coordinates. I showed the kids how the XY coordinates displayed under the Scratch animations area change, as I move the cursor around on the screen. Our discussion then proceeded along the following lines:


  • If I wanted my sprite (the planet, in this case) to move anywhere the cursor moves, what values should I use for the sprite's X and Y coordinates? 
  • The above point was also a good place to talk about variables, and how the change of the cursor position is always reflected in the planet's position. 
  • Should I move the planet around for just a few times or all the time? What kind of a loop should I use here?
  • How can I make Pac-Man always follow the planet? Which loop should I use? 
  • What values should I use for Pac-Man's X and Y coordinates? 
  • Here, the kids quickly saw that without a small degree of separation between the coordinate values of the planet & Pac-Man, the two sprites overlap each other.
  • BTW, the "if-else" clause was purely optional, for those to wanted to add another level to their game. The majority went with just a "go to x() y()"
  • And finally, the interactive part of the game... I put in the requirement that there should "a key press" or "the green flag click" to make the game start, and something similar to end the game. 

In the next one hour, the children came up with multiple variations of the game, making their own sprites and designing various versions of tag... All in all, a very fun class for them and me to wrap up the school year.

Happy Summer!!

Saturday, August 9, 2014

A Follow-up Exercise to Drawing Digital Numbers using Pro-Bot

The following set of questions is a follow-up to drawing digital numbers using Pro-Bot. Rather than draw every number from 0 through 9, these questions allow the students to draw just a sub-set of the numbers. This is how I plan to use it with my students: Write out one or two of the following questions each on chits and let the kids pick the chits randomly. This way, everyone gets to work on a different problem and it allows for a bit of math practice as well.

  1. Use Pro-Bot to draw the odd numbers from 0 to 9 according to the dimensions given in the figure.
  2. Use Pro-Bot to draw the even numbers from 0 to 9 according to the dimensions given in the figure.
  3. Use Pro-Bot to draw the missing number in the following pattern: 0, 3, ___ , 9, 12
  4. Use Pro-Bot to draw the missing numbers in the following pattern: 13, 11, ___ , 7, ___, 3
  5. Use Pro-Bot to draw the numbers that are multiples of 3 in the group 0 to 9.
  6. Use Pro-Bot to draw the numbers that are divisors of 8 in the group 0 to 9.
  7. Use Pro-Bot to draw the number that you get as the result of the problem 2 x 2 x 2 = ?
  8. The sum of 2 numbers is 5. One of the numbers is one more than the other. Use Pro-Bot to draw the two numbers according to the dimensions given.
  9. The difference between two numbers is 3. The sum of the two numbers is same as 5 x 3. Can you identify the numbers? Draw the numbers using Pro-Bot according to the dimensions given below.
  10. If your birthday is a single digit number, draw it using Pro-Bot with the dimensions given below. Else, add up the digits in your birthday and draw that number using Pro-Bot.
  11. Use Pro-Bot to draw the prime numbers in the group 0 to 9. A prime number is a number greater than 1, that can be divided only by 1 and the number itself. It does not have any other divisors.


All measurements in the figure below are in centimeters. 





















Here is a set of programs for drawing the various numbers.