home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 025.lha / Spell-It (.txt) < prev    next >
Encoding:
AmigaBASIC Source Code  |  1987-04-02  |  10.8 KB  |  470 lines

  1.  
  2.   
  3.   CLS
  4.   
  5.   GOTO MainMenu
  6.     
  7.   Parents:
  8.   CLS
  9.   
  10.     PRINT
  11.     PRINT
  12.     PRINT "    This Spelling Program Allows The User To Enter The Words They"
  13.     PRINT "    Want Their Child To Practice. This Allows For Difficulty Levels"
  14.     PRINT "    Which Are Defined By The Parents, Thus Making This Program Usable"
  15.     PRINT "    For Children Of All Grade Levels."
  16.     PRINT
  17.     PRINT "    You Are Able To Create 3 Differant Levels That Are Saved For Future"
  18.     PRINT "    Use On Disk. The Words In Each Level Can Be Changed At Any Time."
  19.     PRINT
  20.     COLOR 3:PRINT "                      - Press Any Key To Continue -"
  21.     GOSUB GetAKey
  22.     COLOR 1
  23.     CLS
  24.     PRINT
  25.     A$ =  "    Here is a sample of my voice"
  26.     PRINT A$;" ..."
  27.     SAY TRANSLATE$ (A$)
  28.     SAY TRANSLATE$ ("It Sometimes Sounds Rather ODD.")
  29.     SAY TRANSLATE$ ("Sorry, but no 1 is perfect")
  30.     
  31.     PRINT
  32.     PRINT "    Sometimes I sound rather odd. To help get around that little problem,"
  33.     PRINT "    I have added the ability to enter both the correct spelling of a word"
  34.     PRINT "    and the PHONETIC spelling of a word. You may have to play around with"
  35.     PRINT "    a word to get it to sound like it should."
  36.     PRINT
  37.     PRINT "    The Main Menu has an option called PHONETIC CHECK. You can select"
  38.     PRINT "    this option to play with phonetic spellings. Spell-It will say the"
  39.     PRINT "    word as you have it entered. Make note of the PHONETIC way that sounds"
  40.     PRINT "    best, you will need it when you actually enter the words to be used"
  41.     PRINT "    in a spelling test."
  42.     PRINT
  43.     
  44.     PRINT "    When entering the words for the spelling test, you will receive two"
  45.     PRINT "    prompts for each word. The first is where you will enter the CORRECT"
  46.     PRINT "    spelling of the word. The next prompt will ask you for the PHONETIC"
  47.     PRINT "    spelling. If you do not wish to use PHONETIC spellings for sound"
  48.     PRINT "    purposes, then press RETURN at the PHONETIC prompt.    
  49.     PRINT
  50.     PRINT
  51.     COLOR 3:PRINT "                      - Press Any Key To Continue -"
  52.     GOSUB GetAKey
  53.     COLOR 1
  54.     CLS
  55.     PRINT
  56.     PRINT
  57.     PRINT "    This is version 1.0 of Spell-It, so hang in there ... perfection"
  58.     PRINT "    has not yet been reached. Spell-It was created because Educational"
  59.     PRINT "    Software for the Amiga seems to be lacking. Spell-It is an attempt"
  60.     PRINT "    to bring educational software to Amiga owners at an affordable"
  61.     PRINT "    price. You have to admit, this is as affordable as you can get."
  62.     PRINT
  63.     PRINT "    Spell-It is the COPYRIGHTED matarial of RB-Data Systems."
  64.     PRINT "    This individual program may be copied and freely distributed "
  65.     PRINT
  66.     COLOR 3
  67.     PRINT "                       PROVIDED NO FEE IS CHARGED"
  68.     COLOR 1
  69.     PRINT
  70.     PRINT "    This includes being part of any disk which is sold that may"
  71.     PRINT "    include other programs."
  72.     PRINT
  73.     COLOR 3
  74.     PRINT "    Version 1.0 has been specially licensed to Digital Publishing"
  75.     PRINT "    for publication in the December 1986 issue of AMIGAZINE!"
  76.     PRINT "    Digital Publishing, P.O. Box 9231, Bakersfield, CA 93389."
  77.     PRINT
  78.     COLOR 3:PRINT "                      - Press Any Key To Continue -"
  79.     GOSUB GetAKey
  80.     COLOR 1
  81.     CLS
  82.  
  83. MainMenu:
  84.   CLEAR
  85.   ON ERROR GOTO ErrorTrap
  86.   CLS
  87.   LOCATE 1,55
  88.   COLOR 3
  89.   PRINT "Spell-It v1.0 (c) 1986"
  90.   LOCATE 2,55
  91.   PRINT "   RB-Data Systems"
  92.   PRINT
  93.   PRINT
  94.   LOCATE 6,35
  95.   COLOR 1
  96.   PRINT "Spell-It Menu"
  97.   COLOR 3
  98.   LOCATE 7,34
  99.   PRINT "==============="
  100.   LOCATE 9,28
  101.   COLOR 3
  102.   PRINT "(1)";:COLOR 1:PRINT " Spelling Test Level 1"
  103.   LOCATE 10,28
  104.   COLOR 3
  105.   PRINT "(2)";:COLOR 1:PRINT " Spelling Test Level 2"
  106.   LOCATE 11,28
  107.   COLOR 3
  108.   PRINT "(3)";:COLOR 1:PRINT " Spelling Test Level 3"
  109.   LOCATE 12,28
  110.   COLOR 3
  111.   PRINT "(4)";:COLOR 1:PRINT " Enter Words For Tests"
  112.   LOCATE 13,28
  113.   COLOR 3
  114.   PRINT "(5)";:COLOR 1:PRINT " Instructions For Parents"
  115.   LOCATE 14,28
  116.   COLOR 3
  117.   PRINT "(6)";:COLOR 1:PRINT " PHONETIC CHECK"
  118.   LOCATE 15,28
  119.   COLOR 3
  120.   PRINT "(7)";:COLOR 1:PRINT " Exit Program"
  121.   
  122. AnswerMenu:
  123.   
  124.   GOSUB GetAKey
  125.     A = VAL(A$)
  126.     IF A < 1 OR A > 7 THEN GOTO AnswerMenu
  127.     IF A = 4 THEN GOTO LevelMenu
  128.     IF A = 5 THEN GOTO Parents
  129.     IF A = 6 THEN GOTO Phonetic
  130.     IF A = 7 THEN CLS:END
  131.     GOTO SpellingTest
  132.     
  133.  
  134.  
  135.  
  136. LevelMenu:
  137.     CLS
  138.     LOCATE 5,27
  139.       PRINT "Enter Words For Which Level?"
  140.     LOCATE 6,27
  141.       PRINT "      ('E' To Exit)"
  142.     
  143.     LOCATE  10,30
  144.       COLOR 3
  145.       PRINT "(1) ";
  146.       COLOR 1
  147.       PRINT "Level One"
  148.     LOCATE 12,30
  149.       COLOR 3
  150.       PRINT "(2) ";
  151.       COLOR 1
  152.       PRINT "Level Two"
  153.     LOCATE 14,30
  154.       COLOR 3
  155.       PRINT "(3) ";
  156.       COLOR 1
  157.       PRINT "Level Three"
  158.       
  159. GetResponse:
  160.   
  161.   GOSUB GetAKey
  162.   
  163.   IF A$ = "E" THEN GOTO MainMenu
  164.   A = VAL(A$)
  165.   IF A <1 OR A > 3 THEN GOTO GetResponse
  166.   
  167. CLS
  168.  
  169.     PRINT
  170.     PRINT "  The Number Of Words Entered At Each Level Is Determined By You. When"
  171.     PRINT "  You Have Entered ALL The Words You Want For This Level, Type The Word"
  172.     PRINT 
  173.     COLOR 3
  174.     PRINT "                                    QUIT "
  175.     COLOR 1
  176.     PRINT
  177.     PRINT "         This Will Bring You Back To The Level Selection Menu."
  178.     PRINT
  179.     PRINT "            You can enter single words, or short sentences."
  180.     PRINT
  181.     PRINT
  182.     
  183.   DataName$ = "Level"+A$+".Dat"
  184.   OPEN "O", #1, DataName$
  185.   Count% = 0
  186.   DIM Word$(100)
  187.   DIM PWord$(100)
  188. EnterData:
  189.   
  190.   Count% = Count% + 1
  191.   COLOR 3
  192.   PRINT "Word #";Count%;":";
  193.   COLOR 1
  194.   INPUT " ",Word$
  195.   Word$ = UCASE$(Word$)
  196.   
  197.   IF Word$ = "QUIT" THEN GOTO FinishWords
  198.   INPUT "Phonetic Spelling ";PWord$
  199.   IF PWord$ = "" THEN PWord$ = "*"
  200.   PRINT
  201.   Word$(Count%) = Word$
  202.   Word$ = ""
  203.   PWord$(Count%) = PWord$
  204.   PWord$ = ""
  205.   
  206. GOTO EnterData
  207.       
  208. FinishWords:
  209.  
  210.   PRINT #1, Count%-1
  211.   
  212.   FOR I = 1 TO Count%-1
  213.     PRINT #1, Word$(I)
  214.     PRINT #1, PWord$(I)
  215.   NEXT I
  216.   
  217.   CLOSE 1
  218.   GOTO MainMenu
  219.     
  220.  
  221. SpellingTest:
  222.    Count% = 0
  223.    CLS
  224.    DataName$ = "Level"+A$+".dat"
  225.    OPEN "I", #1, DataName$
  226.    INPUT #1, NumberOfWords
  227.   
  228.    DIM Wrong$(NumberOfWords)
  229.    DIM WrongSpelling$(NumberOfWords)
  230.    PRINT
  231.    Sentence$ = "I will say a word then u spell it"
  232.    
  233.    SAY TRANSLATE$ (Sentence$)
  234.    SAY TRANSLATE$ ("The First Word IS")
  235.    
  236.    WHILE NOT EOF(1)
  237.      Count% = Count% + 1
  238.      IF Count% > 1 THEN SAY TRANSLATE$ ("The Next Word IS")
  239.      
  240.      INPUT #1, Word$
  241.      INPUT #1, PWord$
  242.      
  243.      
  244.      SayWord:
  245.        IF PWord$ = "*" THEN SAY TRANSLATE$ (Word$) :ELSE SAY TRANSLATE$ (PWord$)
  246.      
  247.      INPUT "      ",Answer$
  248.      Answer$ = UCASE$(Answer$)
  249.      IF Answer$ = Word$ THEN GOSUB RightAnswer :ELSE GOSUB WrongAnswer
  250.      
  251.    WEND
  252.    CLOSE 1
  253.      
  254.      SAY TRANSLATE$ ("That Is All The Words In This Level")
  255.      GOTO FinishedLevel
  256.        
  257.  
  258. RightAnswer:
  259.   RightAnswer% = RightAnswer% + 1
  260.   PRINT
  261.   RETURN
  262.   
  263. WrongAnswer:
  264.   WrongAnswer% = WrongAnswer% + 1
  265.   Wrong$(WrongAnswer%) = Word$
  266.   WrongSpelling$(WrongAnswer%) = Answer$
  267.   COLOR 3
  268.   PRINT "      ";
  269.   SAY TRANSLATE$ ("Sorry")
  270.   SAY TRANSLATE$ ("You Spelled it wrong")
  271.   SAY TRANSLATE$ ("The correct spelling is")
  272.     FOR Correct% = 1 TO LEN(Word$)
  273.       Correct$ = MID$(Word$,Correct%,1)
  274.       GOSUB PronounceLetters
  275.       SAY TRANSLATE$ (Pronounce$)
  276.       PRINT Correct$;
  277.     NEXT Correct%
  278.     PRINT
  279.     
  280.   SAY TRANSLATE$ ("Better Luck Next Time")
  281.   COLOR 1
  282.   PRINT
  283.   
  284.   RETURN
  285.   
  286. FinishedLevel:
  287.  
  288.   CLS
  289.   PRINT
  290.     
  291.     Total% = RightAnswer% + WrongAnswer%
  292.     Total$ = STR$ (Total%)
  293.     RightAnswer$ = STR$(RightAnswer%)
  294.     WrongAnswer$ = STR$(WrongAnswer%)
  295.   
  296.   A$ = "   There were"+Total$+" words in this test.
  297.   SAY TRANSLATE$ (A$)
  298.   PRINT A$
  299.   
  300.   A$ = "   You Spelled"+RightAnswer$+ " correctly, and"+WrongAnswer$+ " wrong."
  301.   SAY TRANSLATE$ (A$)
  302.   PRINT A$
  303.   PRINT
  304.   
  305.   IF WrongAnswer% = 0 THEN GOTO ContinueToMainMenu
  306.   
  307.   A$ = "   Press P to print the words you spelled wrong on your printer"
  308.   SAY TRANSLATE$ (A$)
  309.   PRINT "   Press ";
  310.   COLOR 3
  311.   PRINT "P ";
  312.   COLOR 1
  313.   PRINT "to Print the words you spelled wrong on you printer."
  314.   
  315.   A$ = "    Press S to see the words on your screen"
  316.   SAY TRANSLATE$ (A$)
  317.   PRINT "   Press ";
  318.   COLOR 3
  319.   PRINT "S ";
  320.   COLOR 1
  321.   PRINT "to see the words on your screen."
  322. ContinueToMainMenu:
  323.   PRINT
  324.   A$ = "                         Press Any Key To Continue"
  325.   PRINT A$
  326.   SAY TRANSLATE$ (A$)
  327.   GOSUB GetAKey
  328.  
  329.   IF A$ = "P" THEN GOTO PrintWords
  330.   IF A$ = "S" THEN GOTO SeeWords
  331.  
  332.   GOTO MainMenu
  333.   
  334. PrintWords:
  335.   CLS
  336.   FOR I = 1 TO WrongAnswer%
  337.    LPRINT "     THE WORD WAS:   ";Wrong$(I);"    YOU SPELLED IT:   ";WrongSpelling$(I)
  338.    PRINT  "     The word was :  ";:COLOR 3:PRINT Wrong$(I);:COLOR 1:PRINT "   YOU SPELLED IT: ";:COLOR 3:PRINT WrongSpelling$(I)
  339.    COLOR 1
  340.   NEXT I
  341.  
  342. COLOR 3
  343.  
  344. PRINT
  345. PRINT "                 Any Key To Go To The Main Menu"
  346. GOSUB GetAKey
  347.  
  348. GOTO MainMenu
  349.  
  350. SeeWords:
  351.   CLS
  352.   FOR I = 1 TO WrongAnswer%
  353.     COLOR 1
  354.     PRINT "     The word was:    ";:COLOR 3:PRINT Wrong$(I);:COLOR 1:PRINT "    You Spelled it: ";:COLOR 3:PRINT WrongSpelling$(I)
  355.   NEXT I
  356.  
  357. COLOR 3
  358.  
  359. PRINT
  360. PRINT "                          Any Key To Go To The Main Menu"
  361. GOSUB GetAKey
  362.       
  363. GOTO MainMenu
  364.  
  365. ErrorTrap:
  366.   IF ERR = 5 THEN CLS:LOCATE 10,10:COLOR 3:PRINT "Narrator.Device has been removed from the Work Bench Disk."
  367.   IF ERR = 5 THEN LOCATE 11,10:COLOR 3:PRINT "It must be replaced prior to Spell-It being able to properly run.":GOSUB GetAKey:GOTO MainMenu
  368.   IF ERR = 53 THEN LOCATE 10,10:COLOR 3:PRINT "Sorry, but there has been no words entered for that level.":COLOR 1
  369.   IF ERR = 53 THEN SAY TRANSLATE$ ("Sorry but there has been no words entered for that level"):CLOSE 1:CLOSE 2:GOTO MainMenu
  370.   IF ERR = 55 THEN SAY TRANSLATE$ ("ERROR, File Already Open. Returning to main menu, closing all files.")
  371.   IF ERR = 55 THEN CLOSE 1:CLOSE 2:GOTO MainMenu
  372.   CLS
  373.   COLOR 3
  374.   PRINT "                  *  AN UNTRAPPED ERROR HAS OCCURED   *"
  375.   PRINT "                     ERROR NUMBER IS:";ERR
  376.   PRINT "                  *  ANY KEY TO RETURN TO MAIN MENU   *"
  377.   
  378.   GOSUB GetAKey
  379.   GOTO MainMenu
  380.   
  381. Phonetic:
  382.  
  383.   CLS
  384.   COLOR 3
  385.   PRINT
  386.   PRINT "                                PHONETIC CHECK"
  387.   PRINT "                                =============="
  388.   PRINT
  389.   COLOR 1
  390.   PRINT "    Enter a word at the prompt and press RETURN. Spell-It will then"
  391.   PRINT "    say that word. If it doesn't sound right, then try it again making"
  392.   PRINT "    a few changes in the spelling. The ODD spelling will later be used"
  393.   PRINT "    to help Spell-It pronounce the word so your child will better"
  394.   PRINT "    recognize it. After all, you can't expect the little one to spell"
  395.   PRINT "    a word he or she can't understand."
  396.   PRINT
  397.   
  398.   PRINT "    Type the word QUIT to exit to the main menu.
  399.   PRINT
  400.   PRINT
  401.   PRINT"================================================================================="
  402.   
  403.   PRINT
  404.   PRINT
  405.   PRINT
  406.  
  407.   x = 18: y =10
  408.   t = 0
  409.  
  410. StartPhonetic:
  411.   
  412.   COLOR 3
  413.   LOCATE x,y
  414.   PRINT "    >";:INPUT" ",Word$
  415.   Word$ = UCASE$(Word$)
  416.   IF Word$ = "QUIT" THEN GOTO MainMenu
  417.   
  418.   SAY TRANSLATE$ (Word$)
  419.   x = x +1:t = t + 1
  420.   IF t = 4 THEN y = 30:x = 18
  421.   IF t = 8 THEN y = 50:x = 18
  422.   IF t = 12 GOTO Phonetic
  423.   GOTO StartPhonetic
  424.   
  425.     
  426. PronounceLetters:                      
  427.  
  428.  
  429.   IF Correct$ = "A" THEN Pronounce$ = "AY,":RETURN
  430.   IF Correct$ = "B" THEN Pronounce$ = "BEEEEEE":RETURN
  431.   IF Correct$ = "C" THEN Pronounce$ = "CEEEEEE":RETURN
  432.   IF Correct$ = "D" THEN Pronounce$ = "DEEEEEE":RETURN
  433.   IF Correct$ = "E" THEN Pronounce$ = "EEEEEEE":RETURN
  434.   IF Correct$ = "F" THEN Pronounce$ = "F":RETURN
  435.   IF Correct$ = "G" THEN Pronounce$ = "GEEEEEE":RETURN
  436.   IF Correct$ = "H" THEN Pronounce$ = "AYCH":RETURN
  437.   IF Correct$ = "I" THEN Pronounce$ = "I":RETURN
  438.   IF Correct$ = "J" THEN Pronounce$ = "JAY":RETURN
  439.   IF Correct$ = "K" THEN Pronounce$ = "KAY":RETURN
  440.   IF Correct$ = "L" THEN Pronounce$ = "EL":RETURN
  441.   IF Correct$ = "M" THEN Pronounce$ = "EM":RETURN
  442.   IF Correct$ = "N" THEN Pronounce$ = "EN":RETURN
  443.   IF Correct$ = "O" THEN Pronounce$ = "OH":RETURN
  444.   IF Correct$ = "P" THEN Pronounce$ = "PEEEEEE":RETURN
  445.   IF Correct$ = "Q" THEN Pronounce$ = "Q":RETURN
  446.   IF Correct$ = "R" THEN Pronounce$ = "R":RETURN
  447.   IF Correct$ = "S" THEN Pronounce$ = "S":RETURN
  448.   IF Correct$ = "T" THEN Pronounce$ = "TEEEEEE":RETURN
  449.   IF Correct$ = "U" THEN Pronounce$ = "U":RETURN
  450.   IF Correct$ = "V" THEN Pronounce$ = "VEEEEEE":RETURN
  451.   IF Correct$ = "W" THEN Pronounce$ = "W":RETURN
  452.   IF Correct$ = "X" THEN Pronounce$ = "EX":RETURN
  453.   IF Correct$ = "Y" THEN Pronounce$ = "Y":RETURN
  454.   IF Correct$ = "Z" THEN Pronounce$ = "ZEEEEEE":RETURN
  455.   Pronounce$ = Correct$
  456.   RETURN
  457.   
  458.       
  459.             
  460. GetAKey:
  461.   A$ = INKEY$
  462.   IF A$ = "" THEN GOTO GetAKey
  463.   A$ = UCASE$(A$)
  464.   RETURN
  465.       
  466.  
  467.  
  468.  
  469.  
  470.