alice in summerland

learning and teaching math in alice


Unlike my bedroom and computer desktop, my multiplication table program is now completely clean!

Instructions for the game are displayed as the computer generates a random order of problems to ask the player.

After exhaustively perfecting the movements, timing, positioning, and visuals, this program works even cleaner than I had imagined it. I cleaned up the visuals by changing the space background to a simple navy background. Before today, the code consisted of five methods, many with several parameters, that only somewhat worked, as well as at least ten global variables. I cleaned up the code into three methods: world.myFirstMethod has nothing but a statement to call world.fillRandomly, which randomizes the order that the computer will prompt the user for answers, and world.checkAnswer, which checks to see if the answer is correct. Because complicated yet efficient sorting algorithms would be too complicated for middle school students to learn, the fillRandomly method takes about ten seconds to set up the game, which is not ideal. Thus, during the waiting time, I provide instructions for the game.

The player ended the game early by typing "end".

If the player’s answer is the correct number, checkAnswer will change the color of the number in the table to green and make it visible. Else, if the player’s answer is “end,” then the game ends. Else, if the player’s answer is “answer,” the correct number will appear in red on the table. Else, the player is prompted to try again, and there is a recursive call to checkAnswer with the new answer. Although recursion would be a difficult idea for the kids to learn in a short tutorial, I don’t think that this one line will trouble them too much. We may not even need to use the word “recursion,” if we aren’t ready to teach them the concept. It’s pretty obvious here that recursion is simply being used to recheck the player’s new answer.

The only tiny and currently unfixable problem in the coding of the game is that, when the computer prompts the player for a number, it has to take it in as a string. This has to do with the “.0” problem that I’ve mentioned in many of my previous posts, and I believe that it is the cleanest solution in this case to take in a string. In the checkAnswer method, one line reads “If playerAnswer joined with .0 == realAnswer,” and then continues on with the conditional. The addition of the “.0” onto the playerAnswer string may be difficult to explain in a tutorial, so I’ll have to think about how to justify that decision in my tutorial instructions. Additionally, I’m also going to think about adding a score to keep track of the number of answers the players gets correct, but I currently believe that the red-green ratio on the board enforces a similar feeling that a scoreboard would.

Another decision I need to make is whether or not I want the student coding the program to have to enter the answers manually as they write the program. Since the table and the 121 associated 3D-number objects required an incredible amount of time and meticulousness and not very much practical skill, I’m going to provide a starting world with this arrangement already set up. Thus, the answers will already be there, hidden in the table. Currently, I have an array of size 121 that contains the answers, and it is generated by two nested loops, each running from 0 to 10. The indices of the two loops are multiplied to generate each consecutive answer, i.e. if the outer index equals 5 and the inner index equals 7, then the correct item in the answer array will be set to 5*7=35. Although this would normally be considered a good way to quickly generate the answers, it does not require the students to practice their multiplication. Thus, I may need to change that or have the option to allow the student to manually enter the answers into the array, which would fulfill our goal of having the student learn math while writing the program, not just executing it.

I’ve noticed that in middle school and high school, the word “math” usually refers to solving concrete problems using the typical “plug and chug” method of plugging numbers into a formula and finding a solution. Because the reasoning and derivation behind these formulas is usually not covered, the parameter-solution of this multiplication table program may not perfectly align with the “plug and chug” methods covered in teachers’ lesson plans. I’ll talk to Professor Rodger, Peggy, and Chitra tomorrow ans ask what they think.

I asked Peggy and Chitra to look at the program (before I added some of the finishing touches), and they thought it looked good. I took their suggestions, and I’m excited to see what they think about the program when I see them again on Monday! Hopefully my code will also be understandable. If so, I’ll be ready to go on making the tutorial, meaning that it will definitely be finished by the time of the first workshop at the end of June!

No comments yet»

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

<span>%d</span> bloggers like this: