alice in summerland

learning and teaching math in alice

Farewell, decimals

Today was an important day. Today was the day that Alice learned integers.

multiplyingMatrices is much cleaner now with integers rather than decimals.

Well, Alice has actually already known integers, but they were just hidden in the back of her memory where no one could find then. After all the times I looked for this option in Alice and searched countless forums in the Alice Community, I stumbled upon this solution today when looking for something else. Anyway, to change a decimal to an integer, all you have to do is go to the bottom of the advanced math section in the world’s functions tab and drag ‘int a as a string’ onto whatever number you are trying to change. Pretty simple, yet none of us could find it, so I still doubt that people just learning Alice in middle school would find it either. Nonetheless, it’s there, hallelujah. To the left you’ll see my matrices program, more beautiful than ever, with integers rather than decimals.

Chitra and Peggy looked over two of my tutorials today. Peggy looked over my inequalities tutorial, for which she gave me comments on most slides, most of which were just minor such as mixing up ‘world’s properties’ and ‘world’s methods,’ grammar, and some clarifications. She thought she was “destroying my tutorial” and felt really bad, but I’m glad she made those small mistakes and was obviously not offended since I’m going to be showing this tutorial to a lot of people and want it to be perfect! Chitra looked over my permutations program and noticed that there was a problem in the 4! case where the counter only got up to 20. To fix this, I just changed a loop to run 6 times rather than 5. Simple programming mistake. This gets the counter up to 23. In the 2! and 3! cases, it was easy to get the people to move back to their original positions in one step and count it as the final permutation, but in this more complicated case that’s not so easy. So I decided to just start the counter at 1 in that case and have it count the original order as the first permutation. She also suggested that I include a slide about how to test the program in the middle of the tutorial, which can easily be done for this program. After the 2! case, I added a slide that said that you can run your world by either adding world.permute(numPeople = 2) to world.my first method, or just going to the Events and changing When the world starts from world.my first method to world.permute, and selection 2 for numPeople. This way the programmer can feel some sense of accomplishment after already having coded about 30 slides.

I spent most of the day working on my multiplying matrices program, and it’s really frustrating to fix the awful code. One problem I’m having is in the generateNumebrs method, in the part where I ask the user to type in each number of the matrices he wants to multiply. Right now, the code is messier than it could be because I explicitly write out the case for each number object (there are 8 number objects in two 2×2 matrices). Ideally, this could easily be fixed with a Loop or a helper method. The problem happens when I want to change the text of 3D text objects (the number objects of the matrices) to the numbers (as strings) that the user enters. For 3D objects, you can either use ‘set text to’ in its properties, or you can set its value to a certain string which accomplishes the same thing. In a helper method where I would pass in an object parameter as this number object, I’d like to be able to use this ‘set text to’ property as well. The problem is that Alice doesn’t know that my parameter is going to be a 3D text object, and not some other random object like a camera or something. It makes sense that Alice doesn’t want to use ‘set text to’ because if it were a camera, the program would either crash or have some major problems. How can I promise Alice that my object is going to be a text object? To find an answer to this question, I joined the Alice Community which I have been lurking all summer for answers and asked my first question. Hopefully I’ll get a response by tomorrow!

Advertisements

No comments yet»

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: