PDA

View Full Version : Teaching Multiplication


johnnywas
02-14-2009, 07:00 PM
I have two young girls and this is a simple game I designed to help teach them multiplication. It also gives me practice within Alice. I'm using Alice to familiarise myself with programming concepts

You choose the times tables you want. We calll them Times tables I think Americans have a different name. We're talking 2*2=4 3*2=6. All that stuff

The computer asks questions

If you get the answer right your car speeds up

I would like to work on the programme so the race track was circular and
so both cars were always moving at a minimum speed at all times
but the programming task is currently beyond me

I have a couple of other ideas so may return to this one

Thanks Dr Jim and Dick Baldwin for the advice and tutorials

johnnywas
02-15-2009, 06:37 AM
just to expand on the difficulties I have

the programme is based on asking the user a question (4*4). If he gets the question right the car goes a long way and if he gets it wrong it moves a shorter distance along the track

one of the problems i have is that the programme requires a lot of variables (the random number, the table being tested, the user answer, the computers answer, the distance travelled). these all seem to have to be present in the same method because I haven't found a way to make variables created in one method avialable in another.

I don't think I can manage the other suggested changes (a circular track and a constant speed) without being able to access some of the variables in different methods. otherwise the programme (the Race Method) will soon run to several pages)

grateful for suggestions

DrJim
02-15-2009, 11:52 AM
Maybe the attached will give you a few ideas.

Note that a world level variable remains active as long as the world is running (and then resets to the default). It can also be accessed and modified by any method without restriction. (Note - in this respect Alice 2.0 totally defeats the concept of encapsulation. :( In terms of good programming practice, it would be far better to pass the lap time to the "say" method as a parameter.)

johnnywas
02-15-2009, 01:40 PM
thanks Dr Jim

i see, I should have created most of my variables at world level

very good.

J