[Tutor] my first project: a multiplication trainer

Guba listsdl04 at yahoo.de
Sat Mar 15 05:43:06 CET 2008


Hello everybody,

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:

#######################

A = [1,2,3,4,5,6,7,8,9]
B = [1,2,3,4,5,6,7,8,9]

asked_questions = ()
false_answers = ()

#block 1
While tuple "asked_questions" contains less than 81 items:
	Take one random item from A and one random item from B
	If the question is NOT in "asked_questions":
		Add question to tuple "asked_questions"	
	Calculate the question and wait for user-input	
	print the question # e.g.: 3x6=
	If answer is false:
		add question to the tuple "false_answers"
	print: "You have answered all questions!"	

#######################
	

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?

So far I am not concerned about what to do with the tuple
"false_answers". This I worry about later.

Thanks for your help!

Guba




More information about the Tutor mailing list