[Tutor] my first project: a multiplication trainer

Alan Gauld alan.gauld at btinternet.com
Sat Mar 15 10:26:17 CET 2008


"Guba" <listsdl04 at yahoo.de> wrote

> I want to create a simple multiplication trainer which quizzes me on 
> the
> multiplication table. All multiplication combinations should be 
> asked
> once, without repetition.
>
> Here my pseudo code:


> I would very much appreciate if you could comment on/criticise my 
> pseudo
> code. In particular: is my approach correct, or would it be more
> sensible to first generate (or supply?) all possible questions and 
> then
> select the ready questions randomly?

Personally I'd go for the second approach as being much simpler.
Once you have a list tthere are tools to get random selections
from that or, even easier, to shuffle them into random order before
selection. That will make the code much easier to write I think.


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list