Home » Archimedes archive » Archimedes World » AW-1993-03.adf » AWMar93 » !AWMar93/Goodies/Basic/!Multiply/!Help

!AWMar93/Goodies/Basic/!Multiply/!Help

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1993-03.adf » AWMar93
Filename: !AWMar93/Goodies/Basic/!Multiply/!Help
Read OK:
File size: 0A54 bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents

                                Multiply Game 
                          (C) Archimedes World 1993

Intro

The program on the disk is part of a series, which helps you understand the
programming features of Basic. The program this month is simple in its
concept, and will allow you to understand how variables are used within a
Basic program. 

            (For further information see magazine).

How To Use Multiply

The actual program is very easy to load and use, once the program has loaded
you will be asked to enter your name, this can either be your first name or
full name if you like.

You will now be greeted by a Hello, "your name" which you have already been
asked. The screen also shows a question, which asks you to multiply two
numbers, these numbers are picked at random by the program, there are 10
questions for each game.

If you answer correctly you will be given a message "Well Done", if you
answer incorrectly you will here a sound and a message saying "Your answer
is incorrect", after that it will show you the correct answer. To continue
just press any key on the keyboard, or just wait, you will also be given
your total score as you answer each question. When the game is finaly over
you will recieve a message saying" Your Final Score Was X Out Of X ".

Open Viewer

Use the open viewer to copy the Basic program onto a new disk, if you have
RISC OS 3 you can load the file directly into !Edit, if you have it loaded.


Table Of Variables Used:

A% and B% (These variables give a random number between 1-12) 

If you look at line 360 you will see the variables and there given values,
so for instance if you require to change the numbers to be multiplied try
changing the value in the expression A%=RND(your new value), this can also
be done with the variable B%.

Answer% (This stores the values of A% and B% )

Tries%  (This variable sets a value of 10, that being the number of
         questions)

Score%  (This variable holds the scores, and then shows them after each
         answer)


A$ (This string variable holds the persons name which has been input via
    your keyboard)

Table Of Procedures Used:
                        

PROCscreen (this sets the screen mode used and colours)

PROCinput  (asks the user for his or her name)

PROCinit   (this intialises the variables and there values)

PROCask    (asks the question, of which two numbers to be multiplied)

PROCanswer (this function takes your answer and checks it, if wrong answer
is given then a message is displayed telling you its wrong, and also gives
you the correct answer).


Hope you enjoy the program, see you next month. 

G.Stanley
00000000  0a 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00000010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000020  20 20 4d 75 6c 74 69 70  6c 79 20 47 61 6d 65 20  |  Multiply Game |
00000030  0a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00000040  20 20 20 20 20 20 20 20  20 20 20 28 43 29 20 41  |           (C) A|
00000050  72 63 68 69 6d 65 64 65  73 20 57 6f 72 6c 64 20  |rchimedes World |
00000060  31 39 39 33 0a 0a 49 6e  74 72 6f 0a 0a 54 68 65  |1993..Intro..The|
00000070  20 70 72 6f 67 72 61 6d  20 6f 6e 20 74 68 65 20  | program on the |
00000080  64 69 73 6b 20 69 73 20  70 61 72 74 20 6f 66 20  |disk is part of |
00000090  61 20 73 65 72 69 65 73  2c 20 77 68 69 63 68 20  |a series, which |
000000a0  68 65 6c 70 73 20 79 6f  75 20 75 6e 64 65 72 73  |helps you unders|
000000b0  74 61 6e 64 20 74 68 65  0a 70 72 6f 67 72 61 6d  |tand the.program|
000000c0  6d 69 6e 67 20 66 65 61  74 75 72 65 73 20 6f 66  |ming features of|
000000d0  20 42 61 73 69 63 2e 20  54 68 65 20 70 72 6f 67  | Basic. The prog|
000000e0  72 61 6d 20 74 68 69 73  20 6d 6f 6e 74 68 20 69  |ram this month i|
000000f0  73 20 73 69 6d 70 6c 65  20 69 6e 20 69 74 73 0a  |s simple in its.|
00000100  63 6f 6e 63 65 70 74 2c  20 61 6e 64 20 77 69 6c  |concept, and wil|
00000110  6c 20 61 6c 6c 6f 77 20  79 6f 75 20 74 6f 20 75  |l allow you to u|
00000120  6e 64 65 72 73 74 61 6e  64 20 68 6f 77 20 76 61  |nderstand how va|
00000130  72 69 61 62 6c 65 73 20  61 72 65 20 75 73 65 64  |riables are used|
00000140  20 77 69 74 68 69 6e 20  61 0a 42 61 73 69 63 20  | within a.Basic |
00000150  70 72 6f 67 72 61 6d 2e  20 0a 0a 20 20 20 20 20  |program. ..     |
00000160  20 20 20 20 20 20 20 28  46 6f 72 20 66 75 72 74  |       (For furt|
00000170  68 65 72 20 69 6e 66 6f  72 6d 61 74 69 6f 6e 20  |her information |
00000180  73 65 65 20 6d 61 67 61  7a 69 6e 65 29 2e 0a 0a  |see magazine)...|
00000190  48 6f 77 20 54 6f 20 55  73 65 20 4d 75 6c 74 69  |How To Use Multi|
000001a0  70 6c 79 0a 0a 54 68 65  20 61 63 74 75 61 6c 20  |ply..The actual |
000001b0  70 72 6f 67 72 61 6d 20  69 73 20 76 65 72 79 20  |program is very |
000001c0  65 61 73 79 20 74 6f 20  6c 6f 61 64 20 61 6e 64  |easy to load and|
000001d0  20 75 73 65 2c 20 6f 6e  63 65 20 74 68 65 20 70  | use, once the p|
000001e0  72 6f 67 72 61 6d 20 68  61 73 20 6c 6f 61 64 65  |rogram has loade|
000001f0  64 0a 79 6f 75 20 77 69  6c 6c 20 62 65 20 61 73  |d.you will be as|
00000200  6b 65 64 20 74 6f 20 65  6e 74 65 72 20 79 6f 75  |ked to enter you|
00000210  72 20 6e 61 6d 65 2c 20  74 68 69 73 20 63 61 6e  |r name, this can|
00000220  20 65 69 74 68 65 72 20  62 65 20 79 6f 75 72 20  | either be your |
00000230  66 69 72 73 74 20 6e 61  6d 65 20 6f 72 0a 66 75  |first name or.fu|
00000240  6c 6c 20 6e 61 6d 65 20  69 66 20 79 6f 75 20 6c  |ll name if you l|
00000250  69 6b 65 2e 0a 0a 59 6f  75 20 77 69 6c 6c 20 6e  |ike...You will n|
00000260  6f 77 20 62 65 20 67 72  65 65 74 65 64 20 62 79  |ow be greeted by|
00000270  20 61 20 48 65 6c 6c 6f  2c 20 22 79 6f 75 72 20  | a Hello, "your |
00000280  6e 61 6d 65 22 20 77 68  69 63 68 20 79 6f 75 20  |name" which you |
00000290  68 61 76 65 20 61 6c 72  65 61 64 79 20 62 65 65  |have already bee|
000002a0  6e 0a 61 73 6b 65 64 2e  20 54 68 65 20 73 63 72  |n.asked. The scr|
000002b0  65 65 6e 20 61 6c 73 6f  20 73 68 6f 77 73 20 61  |een also shows a|
000002c0  20 71 75 65 73 74 69 6f  6e 2c 20 77 68 69 63 68  | question, which|
000002d0  20 61 73 6b 73 20 79 6f  75 20 74 6f 20 6d 75 6c  | asks you to mul|
000002e0  74 69 70 6c 79 20 74 77  6f 0a 6e 75 6d 62 65 72  |tiply two.number|
000002f0  73 2c 20 74 68 65 73 65  20 6e 75 6d 62 65 72 73  |s, these numbers|
00000300  20 61 72 65 20 70 69 63  6b 65 64 20 61 74 20 72  | are picked at r|
00000310  61 6e 64 6f 6d 20 62 79  20 74 68 65 20 70 72 6f  |andom by the pro|
00000320  67 72 61 6d 2c 20 74 68  65 72 65 20 61 72 65 20  |gram, there are |
00000330  31 30 0a 71 75 65 73 74  69 6f 6e 73 20 66 6f 72  |10.questions for|
00000340  20 65 61 63 68 20 67 61  6d 65 2e 0a 0a 49 66 20  | each game...If |
00000350  79 6f 75 20 61 6e 73 77  65 72 20 63 6f 72 72 65  |you answer corre|
00000360  63 74 6c 79 20 79 6f 75  20 77 69 6c 6c 20 62 65  |ctly you will be|
00000370  20 67 69 76 65 6e 20 61  20 6d 65 73 73 61 67 65  | given a message|
00000380  20 22 57 65 6c 6c 20 44  6f 6e 65 22 2c 20 69 66  | "Well Done", if|
00000390  20 79 6f 75 0a 61 6e 73  77 65 72 20 69 6e 63 6f  | you.answer inco|
000003a0  72 72 65 63 74 6c 79 20  79 6f 75 20 77 69 6c 6c  |rrectly you will|
000003b0  20 68 65 72 65 20 61 20  73 6f 75 6e 64 20 61 6e  | here a sound an|
000003c0  64 20 61 20 6d 65 73 73  61 67 65 20 73 61 79 69  |d a message sayi|
000003d0  6e 67 20 22 59 6f 75 72  20 61 6e 73 77 65 72 0a  |ng "Your answer.|
000003e0  69 73 20 69 6e 63 6f 72  72 65 63 74 22 2c 20 61  |is incorrect", a|
000003f0  66 74 65 72 20 74 68 61  74 20 69 74 20 77 69 6c  |fter that it wil|
00000400  6c 20 73 68 6f 77 20 79  6f 75 20 74 68 65 20 63  |l show you the c|
00000410  6f 72 72 65 63 74 20 61  6e 73 77 65 72 2e 20 54  |orrect answer. T|
00000420  6f 20 63 6f 6e 74 69 6e  75 65 0a 6a 75 73 74 20  |o continue.just |
00000430  70 72 65 73 73 20 61 6e  79 20 6b 65 79 20 6f 6e  |press any key on|
00000440  20 74 68 65 20 6b 65 79  62 6f 61 72 64 2c 20 6f  | the keyboard, o|
00000450  72 20 6a 75 73 74 20 77  61 69 74 2c 20 79 6f 75  |r just wait, you|
00000460  20 77 69 6c 6c 20 61 6c  73 6f 20 62 65 20 67 69  | will also be gi|
00000470  76 65 6e 0a 79 6f 75 72  20 74 6f 74 61 6c 20 73  |ven.your total s|
00000480  63 6f 72 65 20 61 73 20  79 6f 75 20 61 6e 73 77  |core as you answ|
00000490  65 72 20 65 61 63 68 20  71 75 65 73 74 69 6f 6e  |er each question|
000004a0  2e 20 57 68 65 6e 20 74  68 65 20 67 61 6d 65 20  |. When the game |
000004b0  69 73 20 66 69 6e 61 6c  79 20 6f 76 65 72 0a 79  |is finaly over.y|
000004c0  6f 75 20 77 69 6c 6c 20  72 65 63 69 65 76 65 20  |ou will recieve |
000004d0  61 20 6d 65 73 73 61 67  65 20 73 61 79 69 6e 67  |a message saying|
000004e0  22 20 59 6f 75 72 20 46  69 6e 61 6c 20 53 63 6f  |" Your Final Sco|
000004f0  72 65 20 57 61 73 20 58  20 4f 75 74 20 4f 66 20  |re Was X Out Of |
00000500  58 20 22 2e 0a 0a 4f 70  65 6e 20 56 69 65 77 65  |X "...Open Viewe|
00000510  72 0a 0a 55 73 65 20 74  68 65 20 6f 70 65 6e 20  |r..Use the open |
00000520  76 69 65 77 65 72 20 74  6f 20 63 6f 70 79 20 74  |viewer to copy t|
00000530  68 65 20 42 61 73 69 63  20 70 72 6f 67 72 61 6d  |he Basic program|
00000540  20 6f 6e 74 6f 20 61 20  6e 65 77 20 64 69 73 6b  | onto a new disk|
00000550  2c 20 69 66 20 79 6f 75  20 68 61 76 65 0a 52 49  |, if you have.RI|
00000560  53 43 20 4f 53 20 33 20  79 6f 75 20 63 61 6e 20  |SC OS 3 you can |
00000570  6c 6f 61 64 20 74 68 65  20 66 69 6c 65 20 64 69  |load the file di|
00000580  72 65 63 74 6c 79 20 69  6e 74 6f 20 21 45 64 69  |rectly into !Edi|
00000590  74 2c 20 69 66 20 79 6f  75 20 68 61 76 65 20 69  |t, if you have i|
000005a0  74 20 6c 6f 61 64 65 64  2e 0a 0a 0a 54 61 62 6c  |t loaded....Tabl|
000005b0  65 20 4f 66 20 56 61 72  69 61 62 6c 65 73 20 55  |e Of Variables U|
000005c0  73 65 64 3a 0a 0a 41 25  20 61 6e 64 20 42 25 20  |sed:..A% and B% |
000005d0  28 54 68 65 73 65 20 76  61 72 69 61 62 6c 65 73  |(These variables|
000005e0  20 67 69 76 65 20 61 20  72 61 6e 64 6f 6d 20 6e  | give a random n|
000005f0  75 6d 62 65 72 20 62 65  74 77 65 65 6e 20 31 2d  |umber between 1-|
00000600  31 32 29 20 0a 0a 49 66  20 79 6f 75 20 6c 6f 6f  |12) ..If you loo|
00000610  6b 20 61 74 20 6c 69 6e  65 20 33 36 30 20 79 6f  |k at line 360 yo|
00000620  75 20 77 69 6c 6c 20 73  65 65 20 74 68 65 20 76  |u will see the v|
00000630  61 72 69 61 62 6c 65 73  20 61 6e 64 20 74 68 65  |ariables and the|
00000640  72 65 20 67 69 76 65 6e  20 76 61 6c 75 65 73 2c  |re given values,|
00000650  0a 73 6f 20 66 6f 72 20  69 6e 73 74 61 6e 63 65  |.so for instance|
00000660  20 69 66 20 79 6f 75 20  72 65 71 75 69 72 65 20  | if you require |
00000670  74 6f 20 63 68 61 6e 67  65 20 74 68 65 20 6e 75  |to change the nu|
00000680  6d 62 65 72 73 20 74 6f  20 62 65 20 6d 75 6c 74  |mbers to be mult|
00000690  69 70 6c 69 65 64 20 74  72 79 0a 63 68 61 6e 67  |iplied try.chang|
000006a0  69 6e 67 20 74 68 65 20  76 61 6c 75 65 20 69 6e  |ing the value in|
000006b0  20 74 68 65 20 65 78 70  72 65 73 73 69 6f 6e 20  | the expression |
000006c0  41 25 3d 52 4e 44 28 79  6f 75 72 20 6e 65 77 20  |A%=RND(your new |
000006d0  76 61 6c 75 65 29 2c 20  74 68 69 73 20 63 61 6e  |value), this can|
000006e0  20 61 6c 73 6f 0a 62 65  20 64 6f 6e 65 20 77 69  | also.be done wi|
000006f0  74 68 20 74 68 65 20 76  61 72 69 61 62 6c 65 20  |th the variable |
00000700  42 25 2e 0a 0a 41 6e 73  77 65 72 25 20 28 54 68  |B%...Answer% (Th|
00000710  69 73 20 73 74 6f 72 65  73 20 74 68 65 20 76 61  |is stores the va|
00000720  6c 75 65 73 20 6f 66 20  41 25 20 61 6e 64 20 42  |lues of A% and B|
00000730  25 20 29 0a 0a 54 72 69  65 73 25 20 20 28 54 68  |% )..Tries%  (Th|
00000740  69 73 20 76 61 72 69 61  62 6c 65 20 73 65 74 73  |is variable sets|
00000750  20 61 20 76 61 6c 75 65  20 6f 66 20 31 30 2c 20  | a value of 10, |
00000760  74 68 61 74 20 62 65 69  6e 67 20 74 68 65 20 6e  |that being the n|
00000770  75 6d 62 65 72 20 6f 66  0a 20 20 20 20 20 20 20  |umber of.       |
00000780  20 20 71 75 65 73 74 69  6f 6e 73 29 0a 0a 53 63  |  questions)..Sc|
00000790  6f 72 65 25 20 20 28 54  68 69 73 20 76 61 72 69  |ore%  (This vari|
000007a0  61 62 6c 65 20 68 6f 6c  64 73 20 74 68 65 20 73  |able holds the s|
000007b0  63 6f 72 65 73 2c 20 61  6e 64 20 74 68 65 6e 20  |cores, and then |
000007c0  73 68 6f 77 73 20 74 68  65 6d 20 61 66 74 65 72  |shows them after|
000007d0  20 65 61 63 68 0a 20 20  20 20 20 20 20 20 20 61  | each.         a|
000007e0  6e 73 77 65 72 29 0a 0a  0a 41 24 20 28 54 68 69  |nswer)...A$ (Thi|
000007f0  73 20 73 74 72 69 6e 67  20 76 61 72 69 61 62 6c  |s string variabl|
00000800  65 20 68 6f 6c 64 73 20  74 68 65 20 70 65 72 73  |e holds the pers|
00000810  6f 6e 73 20 6e 61 6d 65  20 77 68 69 63 68 20 68  |ons name which h|
00000820  61 73 20 62 65 65 6e 20  69 6e 70 75 74 20 76 69  |as been input vi|
00000830  61 0a 20 20 20 20 79 6f  75 72 20 6b 65 79 62 6f  |a.    your keybo|
00000840  61 72 64 29 0a 0a 54 61  62 6c 65 20 4f 66 20 50  |ard)..Table Of P|
00000850  72 6f 63 65 64 75 72 65  73 20 55 73 65 64 3a 0a  |rocedures Used:.|
00000860  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000870  20 20 20 20 20 20 20 20  0a 0a 50 52 4f 43 73 63  |        ..PROCsc|
00000880  72 65 65 6e 20 28 74 68  69 73 20 73 65 74 73 20  |reen (this sets |
00000890  74 68 65 20 73 63 72 65  65 6e 20 6d 6f 64 65 20  |the screen mode |
000008a0  75 73 65 64 20 61 6e 64  20 63 6f 6c 6f 75 72 73  |used and colours|
000008b0  29 0a 0a 50 52 4f 43 69  6e 70 75 74 20 20 28 61  |)..PROCinput  (a|
000008c0  73 6b 73 20 74 68 65 20  75 73 65 72 20 66 6f 72  |sks the user for|
000008d0  20 68 69 73 20 6f 72 20  68 65 72 20 6e 61 6d 65  | his or her name|
000008e0  29 0a 0a 50 52 4f 43 69  6e 69 74 20 20 20 28 74  |)..PROCinit   (t|
000008f0  68 69 73 20 69 6e 74 69  61 6c 69 73 65 73 20 74  |his intialises t|
00000900  68 65 20 76 61 72 69 61  62 6c 65 73 20 61 6e 64  |he variables and|
00000910  20 74 68 65 72 65 20 76  61 6c 75 65 73 29 0a 0a  | there values)..|
00000920  50 52 4f 43 61 73 6b 20  20 20 20 28 61 73 6b 73  |PROCask    (asks|
00000930  20 74 68 65 20 71 75 65  73 74 69 6f 6e 2c 20 6f  | the question, o|
00000940  66 20 77 68 69 63 68 20  74 77 6f 20 6e 75 6d 62  |f which two numb|
00000950  65 72 73 20 74 6f 20 62  65 20 6d 75 6c 74 69 70  |ers to be multip|
00000960  6c 69 65 64 29 0a 0a 50  52 4f 43 61 6e 73 77 65  |lied)..PROCanswe|
00000970  72 20 28 74 68 69 73 20  66 75 6e 63 74 69 6f 6e  |r (this function|
00000980  20 74 61 6b 65 73 20 79  6f 75 72 20 61 6e 73 77  | takes your answ|
00000990  65 72 20 61 6e 64 20 63  68 65 63 6b 73 20 69 74  |er and checks it|
000009a0  2c 20 69 66 20 77 72 6f  6e 67 20 61 6e 73 77 65  |, if wrong answe|
000009b0  72 0a 69 73 20 67 69 76  65 6e 20 74 68 65 6e 20  |r.is given then |
000009c0  61 20 6d 65 73 73 61 67  65 20 69 73 20 64 69 73  |a message is dis|
000009d0  70 6c 61 79 65 64 20 74  65 6c 6c 69 6e 67 20 79  |played telling y|
000009e0  6f 75 20 69 74 73 20 77  72 6f 6e 67 2c 20 61 6e  |ou its wrong, an|
000009f0  64 20 61 6c 73 6f 20 67  69 76 65 73 0a 79 6f 75  |d also gives.you|
00000a00  20 74 68 65 20 63 6f 72  72 65 63 74 20 61 6e 73  | the correct ans|
00000a10  77 65 72 29 2e 0a 0a 0a  48 6f 70 65 20 79 6f 75  |wer)....Hope you|
00000a20  20 65 6e 6a 6f 79 20 74  68 65 20 70 72 6f 67 72  | enjoy the progr|
00000a30  61 6d 2c 20 73 65 65 20  79 6f 75 20 6e 65 78 74  |am, see you next|
00000a40  20 6d 6f 6e 74 68 2e 20  0a 0a 47 2e 53 74 61 6e  | month. ..G.Stan|
00000a50  6c 65 79 0a                                       |ley.|
00000a54