Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
Teaching Multiplication
Old
johnnywas
Guest
 
Status:
Posts: n/a
Default Teaching Multiplication - 02-14-2009, 06: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
Attached Files
File Type: a2w Times Race4.a2w (1,009.1 KB, 34 views)
   
Reply With Quote
Old
johnnywas
Guest
 
Status:
Posts: n/a
Default 02-15-2009, 05: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
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 02-15-2009, 10: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.)
Attached Files
File Type: a2w Car in Circle.a2w (899.0 KB, 22 views)
   
Reply With Quote
Old
johnnywas
Guest
 
Status:
Posts: n/a
Default 02-15-2009, 12:40 PM

thanks Dr Jim

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

very good.

J
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.