Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: A4000_Mad on January 30, 2008, 02:47:10 PM

Title: HELP! requested with Times Tables program for children
Post by: A4000_Mad on January 30, 2008, 02:47:10 PM
Hi,

I've finally found on Aminet what I hope will be a great Times Tables program for my 6 year old daughter.

At first I was stuck because I was being told "Sorry, can not mount/find speak-handler" even though I had 'speak-handler' in L along with the required 'narrator.device' in Devs and 'tanslator.library' in Libs. What I could not find was the file 'Speak' to go in Workbench:Storage/DOSDrivers of OS3.9. The author said to search the Internet or a Workbench1.3 floppy for the file 'Speak'. Eventually I realised that he must have meant the file 'Say' and proceeded to rename the fully working file 'Say' as 'Speak'.

This has got it to past the "Sorry, can not mount/find speak-handler" report, but I now get the error at the bottom of the screengrab below.

(http://i120.photobucket.com/albums/o164/Cyberstorm604e/TimesTables.jpg)

i.e.

+++ ERROR 18 in line 21: Invalid argument to function
Command returned 10/18: Invalid argument to function


So, can anyone tell me what is wrong with this for the 'TimesTables_All.rexx' please :-?

/* All times tables */

LF=d2c(10); table.='Zero'; Praise.='Yes'
esc=d2c(27)
call table
call reply

/* test for speak handler */
DO
  address command 'assign >NIL: speak: exists'
  if rc~=0 then address command 'Mount >nil: speak:'
  if rc~=0 then do
    say 'Sorry. Can not mount/find speak-handler...';exit
  end
  else open(out,'speak:','w')
END

say 'Hello. Welcome to times table practice.'
say 'Enter X for an answer when you want to stop'lf

writeln(out,"Hello. Welcome to times tables practiss. Enter X for an answer when you want to stop.")

Do forever
  kernel=randu(right(time(),2))*1000000000
  seed1=random(0,12,kernel)
  seed2=random(0,12,kernel)
  flashcard='What is 'table.seed2' times 'table.seed1'?'
  call drill
end
quit:
say 'Exiting...'
EXIT

drill:
say 'What is 'Seed2' x 'Seed1
writeln(out,flashcard)
Do forever
  Pull answer
  if upper(answer)='X' then signal quit
  else if answer=seed2*seed1 then do
  dice=random(0,20,kernel)
/*    dice=random(0,20,seed1) */
    writeln(out,Praise.dice)
    say esc'[0;0H'||esc||'[J'
    return
  end
  else writeln(out,"Wrong. Please try again.")
end
return

table:
table.0='zero'
table.1='one'
table.2='two'
table.3='three'
table.4='four'
table.5='five'
table.6='six'
table.7='seven'
table.8='eight'
table.9='nine'
table.10='ten'
table.11='a lehven'
table.12='twelve'
return

Reply:
Praise.0='Good for you.'
Praise.1='Right.'
Praise.2='Perfect.'
Praise.3='Good.'
Praise.4='Right on.'
Praise.5='Yes.'
Praise.6='You got it.'
Praise.7='Good answer.'
Praise.8='Super.'
Praise.9='That is right.'
Praise.10='Correct.'
Praise.11='Uh huh!'
Praise.12='Keep it up! You are doing fine.'
Praise.13='Right! You will soon be an expert!'
Praise.14='Oh kay.'
Praise.15='Yes. I thought I could trick you with that one.'
Praise.16='Great'
Praise.17='Way to go.'
return
 

NOTE: The other 12 all fail with the same error at line 23. I'm feel pretty sure it's the same problem and that they just have a couple of extra lines.

Thanks very much.
Title: Re: HELP! requested with Times Tables program for children
Post by: foleyjo on January 30, 2008, 02:51:21 PM
Slightly off topic but have you tried the Fun Schools collections to help teach your daughter
Title: Re: HELP! requested with Times Tables program for children
Post by: A4000_Mad on January 30, 2008, 03:00:58 PM
Yes I have thank you. I'm not after any sort of  game or fun thing. I just want a program that displays the sums for her to put the answers. The one above seems perfect with the added bonus of using 'Say' which she loves playing around with anyway.

She's quite advanced and has just started using Brain Training on her Nintendo DS. This has made her eager to learn her tables as quickly as possible. She has her own A1200 Desktop and I would like it to be able to help her :-)
Title: Re: HELP! requested with Times Tables program for children
Post by: motorollin on January 30, 2008, 03:16:11 PM
Did you start rexxmast before running the ARexx script?

--
moto
Title: Re: HELP! requested with Times Tables program for children
Post by: A4000_Mad on January 30, 2008, 03:36:27 PM
ARexx.... Gulp!

I've just double clicked on RexxMast in the Workbench:System drawer and it says "REXX server already active". No difference running the Times Tables after doing that. Was that what you meant to do moto?  
Title: Re: HELP! requested with Times Tables program for children
Post by: meega on January 30, 2008, 03:36:52 PM
WB 1.3 Mountlist entry...

SPEAK:
Handler = L:Speak-Handler
Stacksize = 6000
Priority = 5
GlobVec = -1
#


I don't think you are supposed to rename Say as Speak, I think you are supposed to "Mount SPEAK:" and then use Say as a command. That's how it works for me.
Title: Re: HELP! requested with Times Tables program for children
Post by: motorollin on January 30, 2008, 03:50:55 PM
Yes that's what I meant A4000_Mad. The error that the Rexx server is already running means you don't need to do this manually (it's probably in WBStartup). Line 21 seems to be the following line:

writeln(out,"Hello. Welcome to times tables practiss. Enter X for an answer when you want to stop.")

though I don't know whether numbering starts at 0 or 1, and whether or not it counts comments and blank lines as a line or not. If it is that line, then the syntax looks ok so it's definitely worth checking what Meega suggested (make sure the SPEAK: mountlist entry is in SYS:Storage/DOSDrivers and do Mount Speak: before running the app).

--
moto
Title: Re: HELP! requested with Times Tables program for children
Post by: A4000_Mad on January 30, 2008, 05:04:32 PM
Little Dana is happily learning her tables with a beaming smile on her face right now :banana:

The program is displaying the sums and speaking them to her. She likes hearing its comments after she gets an answer right  :-)


@ meega

That was spot on thank you very much :pint:


@ moto

Many thanks for your help :pint:


:cheers:
Title: Re: HELP! requested with Times Tables program for children
Post by: tokyoracer on January 30, 2008, 05:12:08 PM
I grew up with one of the fun schools (7-13 or something I think), it was a big influence and was very fun in a younger version of me's point of view. And i'm hard to please. :lol:
Title: Re: HELP! requested with Times Tables program for children
Post by: Castellen on January 30, 2008, 06:31:14 PM
A few years ago when I was learning ANSI C at Polytech, one assignment was a maths practice program for children.
It included a disk based database to store the users' names, scores, age as well as an adjustable difficulty level.

Download it here (http://amiga.serveftp.net/Temp/MathsTest.lha) if you want a look.  I wrote it using SAS/C on AmigaOS, mainly because the annoying M$ Visual Studio thing the Polytech "suggested" to use was too overcomplicated and truly hideous overall.

My maths test program is a piece of crap too, but it works fine.  Scored me 100% as a result, so it's done it's job.

Title: Re: HELP! requested with Times Tables program for children
Post by: A4000_Mad on January 30, 2008, 07:28:29 PM
@ Castellen

I've downloaded and tried your program. It's brilliant! Obviously addition, subtraction and division were things I would have had to find too. I won't have to spend ages filling sheets of paper with sums and marking them now mate. Her A1200 Desktop can do it all 8-)

Many thanks :pint: