Home » CEEFAX disks » telesoftware17.adl » 25-08-89/T\Curio

25-08-89/T\Curio

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 » CEEFAX disks » telesoftware17.adl
Filename: 25-08-89/T\Curio
Read OK:
File size: 0814 bytes
Load address: 0000
Exec address: FFFFFFFF
File contents
A CURIOSITY.

A pointless, but interesting program from Ray Elder.

A few weeks ago my eldest brought home a piece of work related to her
coursework for the new GCSE exam. As I was bored at the time and also
felt that I should show a parental interest, I asked her what she was
doing. This program is a result of that coursework.

THE TASK:

The subject was maths (not my most favourite) and the work was as
follows:

Take any multiplication table and calculate each step. If the result is
greater than 9 (ie.two or more digits) then add the digits together.
Repeat until the product is a single digit. For example:

 5 x 1 = 5 ... Product = 5
 5 x 2 = 10 .. Product = 1+0 = 1
 5 x 3 = 15 .. Product = 1+5 = 6  ...etc.

 5 times 23= 115 . Product = 1+1+5 = 7  ...etc.

Using graph paper, draw a line vertically up for the length of the first
product, then for each other product draw a line at 90 degrees clockwise
to the end of the previous line of length equal to the product.

So for our 5 times table example the first line is 5 units upwards, the
next line 1 unit long going to the right, followed by a line of 6 units
downwards followed by a line of 2 units going to the left ... and so on.

How many different patterns can be formed?

There is no limit to the number of tables to be used and at first sight I
thought she had a piece of work that would take a life time. I could
imagine her at 60 still working out 23897 times 1, 23897 times 2. So I
thought that a program to do the calculations would be useful, as even
using a calculator would mean entering each sum one at a time.

So I took on the task of utilising the computers graphics facilities and
produced this program, with surprising results. Try it yourself, curious
isn't it!

Due to the computer screen pixels not being square there may be some
slight distortion of the patterns. This is best seen when processing
the 9 times table. The result should be a perfect square.

The program is written to allow the easy addition of any refinements of
your own, such as screen print routines and so on.
00000000  41 20 43 55 52 49 4f 53  49 54 59 2e 0d 0d 41 20  |A CURIOSITY...A |
00000010  70 6f 69 6e 74 6c 65 73  73 2c 20 62 75 74 20 69  |pointless, but i|
00000020  6e 74 65 72 65 73 74 69  6e 67 20 70 72 6f 67 72  |nteresting progr|
00000030  61 6d 20 66 72 6f 6d 20  52 61 79 20 45 6c 64 65  |am from Ray Elde|
00000040  72 2e 0d 0d 41 20 66 65  77 20 77 65 65 6b 73 20  |r...A few weeks |
00000050  61 67 6f 20 6d 79 20 65  6c 64 65 73 74 20 62 72  |ago my eldest br|
00000060  6f 75 67 68 74 20 68 6f  6d 65 20 61 20 70 69 65  |ought home a pie|
00000070  63 65 20 6f 66 20 77 6f  72 6b 20 72 65 6c 61 74  |ce of work relat|
00000080  65 64 20 74 6f 20 68 65  72 0d 63 6f 75 72 73 65  |ed to her.course|
00000090  77 6f 72 6b 20 66 6f 72  20 74 68 65 20 6e 65 77  |work for the new|
000000a0  20 47 43 53 45 20 65 78  61 6d 2e 20 41 73 20 49  | GCSE exam. As I|
000000b0  20 77 61 73 20 62 6f 72  65 64 20 61 74 20 74 68  | was bored at th|
000000c0  65 20 74 69 6d 65 20 61  6e 64 20 61 6c 73 6f 0d  |e time and also.|
000000d0  66 65 6c 74 20 74 68 61  74 20 49 20 73 68 6f 75  |felt that I shou|
000000e0  6c 64 20 73 68 6f 77 20  61 20 70 61 72 65 6e 74  |ld show a parent|
000000f0  61 6c 20 69 6e 74 65 72  65 73 74 2c 20 49 20 61  |al interest, I a|
00000100  73 6b 65 64 20 68 65 72  20 77 68 61 74 20 73 68  |sked her what sh|
00000110  65 20 77 61 73 0d 64 6f  69 6e 67 2e 20 54 68 69  |e was.doing. Thi|
00000120  73 20 70 72 6f 67 72 61  6d 20 69 73 20 61 20 72  |s program is a r|
00000130  65 73 75 6c 74 20 6f 66  20 74 68 61 74 20 63 6f  |esult of that co|
00000140  75 72 73 65 77 6f 72 6b  2e 0d 0d 54 48 45 20 54  |ursework...THE T|
00000150  41 53 4b 3a 0d 0d 54 68  65 20 73 75 62 6a 65 63  |ASK:..The subjec|
00000160  74 20 77 61 73 20 6d 61  74 68 73 20 28 6e 6f 74  |t was maths (not|
00000170  20 6d 79 20 6d 6f 73 74  20 66 61 76 6f 75 72 69  | my most favouri|
00000180  74 65 29 20 61 6e 64 20  74 68 65 20 77 6f 72 6b  |te) and the work|
00000190  20 77 61 73 20 61 73 0d  66 6f 6c 6c 6f 77 73 3a  | was as.follows:|
000001a0  0d 0d 54 61 6b 65 20 61  6e 79 20 6d 75 6c 74 69  |..Take any multi|
000001b0  70 6c 69 63 61 74 69 6f  6e 20 74 61 62 6c 65 20  |plication table |
000001c0  61 6e 64 20 63 61 6c 63  75 6c 61 74 65 20 65 61  |and calculate ea|
000001d0  63 68 20 73 74 65 70 2e  20 49 66 20 74 68 65 20  |ch step. If the |
000001e0  72 65 73 75 6c 74 20 69  73 0d 67 72 65 61 74 65  |result is.greate|
000001f0  72 20 74 68 61 6e 20 39  20 28 69 65 2e 74 77 6f  |r than 9 (ie.two|
00000200  20 6f 72 20 6d 6f 72 65  20 64 69 67 69 74 73 29  | or more digits)|
00000210  20 74 68 65 6e 20 61 64  64 20 74 68 65 20 64 69  | then add the di|
00000220  67 69 74 73 20 74 6f 67  65 74 68 65 72 2e 0d 52  |gits together..R|
00000230  65 70 65 61 74 20 75 6e  74 69 6c 20 74 68 65 20  |epeat until the |
00000240  70 72 6f 64 75 63 74 20  69 73 20 61 20 73 69 6e  |product is a sin|
00000250  67 6c 65 20 64 69 67 69  74 2e 20 46 6f 72 20 65  |gle digit. For e|
00000260  78 61 6d 70 6c 65 3a 0d  0d 20 35 20 78 20 31 20  |xample:.. 5 x 1 |
00000270  3d 20 35 20 2e 2e 2e 20  50 72 6f 64 75 63 74 20  |= 5 ... Product |
00000280  3d 20 35 0d 20 35 20 78  20 32 20 3d 20 31 30 20  |= 5. 5 x 2 = 10 |
00000290  2e 2e 20 50 72 6f 64 75  63 74 20 3d 20 31 2b 30  |.. Product = 1+0|
000002a0  20 3d 20 31 0d 20 35 20  78 20 33 20 3d 20 31 35  | = 1. 5 x 3 = 15|
000002b0  20 2e 2e 20 50 72 6f 64  75 63 74 20 3d 20 31 2b  | .. Product = 1+|
000002c0  35 20 3d 20 36 20 20 2e  2e 2e 65 74 63 2e 0d 0d  |5 = 6  ...etc...|
000002d0  20 35 20 74 69 6d 65 73  20 32 33 3d 20 31 31 35  | 5 times 23= 115|
000002e0  20 2e 20 50 72 6f 64 75  63 74 20 3d 20 31 2b 31  | . Product = 1+1|
000002f0  2b 35 20 3d 20 37 20 20  2e 2e 2e 65 74 63 2e 0d  |+5 = 7  ...etc..|
00000300  0d 55 73 69 6e 67 20 67  72 61 70 68 20 70 61 70  |.Using graph pap|
00000310  65 72 2c 20 64 72 61 77  20 61 20 6c 69 6e 65 20  |er, draw a line |
00000320  76 65 72 74 69 63 61 6c  6c 79 20 75 70 20 66 6f  |vertically up fo|
00000330  72 20 74 68 65 20 6c 65  6e 67 74 68 20 6f 66 20  |r the length of |
00000340  74 68 65 20 66 69 72 73  74 0d 70 72 6f 64 75 63  |the first.produc|
00000350  74 2c 20 74 68 65 6e 20  66 6f 72 20 65 61 63 68  |t, then for each|
00000360  20 6f 74 68 65 72 20 70  72 6f 64 75 63 74 20 64  | other product d|
00000370  72 61 77 20 61 20 6c 69  6e 65 20 61 74 20 39 30  |raw a line at 90|
00000380  20 64 65 67 72 65 65 73  20 63 6c 6f 63 6b 77 69  | degrees clockwi|
00000390  73 65 0d 74 6f 20 74 68  65 20 65 6e 64 20 6f 66  |se.to the end of|
000003a0  20 74 68 65 20 70 72 65  76 69 6f 75 73 20 6c 69  | the previous li|
000003b0  6e 65 20 6f 66 20 6c 65  6e 67 74 68 20 65 71 75  |ne of length equ|
000003c0  61 6c 20 74 6f 20 74 68  65 20 70 72 6f 64 75 63  |al to the produc|
000003d0  74 2e 0d 0d 53 6f 20 66  6f 72 20 6f 75 72 20 35  |t...So for our 5|
000003e0  20 74 69 6d 65 73 20 74  61 62 6c 65 20 65 78 61  | times table exa|
000003f0  6d 70 6c 65 20 74 68 65  20 66 69 72 73 74 20 6c  |mple the first l|
00000400  69 6e 65 20 69 73 20 35  20 75 6e 69 74 73 20 75  |ine is 5 units u|
00000410  70 77 61 72 64 73 2c 20  74 68 65 0d 6e 65 78 74  |pwards, the.next|
00000420  20 6c 69 6e 65 20 31 20  75 6e 69 74 20 6c 6f 6e  | line 1 unit lon|
00000430  67 20 67 6f 69 6e 67 20  74 6f 20 74 68 65 20 72  |g going to the r|
00000440  69 67 68 74 2c 20 66 6f  6c 6c 6f 77 65 64 20 62  |ight, followed b|
00000450  79 20 61 20 6c 69 6e 65  20 6f 66 20 36 20 75 6e  |y a line of 6 un|
00000460  69 74 73 0d 64 6f 77 6e  77 61 72 64 73 20 66 6f  |its.downwards fo|
00000470  6c 6c 6f 77 65 64 20 62  79 20 61 20 6c 69 6e 65  |llowed by a line|
00000480  20 6f 66 20 32 20 75 6e  69 74 73 20 67 6f 69 6e  | of 2 units goin|
00000490  67 20 74 6f 20 74 68 65  20 6c 65 66 74 20 2e 2e  |g to the left ..|
000004a0  2e 20 61 6e 64 20 73 6f  20 6f 6e 2e 0d 0d 48 6f  |. and so on...Ho|
000004b0  77 20 6d 61 6e 79 20 64  69 66 66 65 72 65 6e 74  |w many different|
000004c0  20 70 61 74 74 65 72 6e  73 20 63 61 6e 20 62 65  | patterns can be|
000004d0  20 66 6f 72 6d 65 64 3f  0d 0d 54 68 65 72 65 20  | formed?..There |
000004e0  69 73 20 6e 6f 20 6c 69  6d 69 74 20 74 6f 20 74  |is no limit to t|
000004f0  68 65 20 6e 75 6d 62 65  72 20 6f 66 20 74 61 62  |he number of tab|
00000500  6c 65 73 20 74 6f 20 62  65 20 75 73 65 64 20 61  |les to be used a|
00000510  6e 64 20 61 74 20 66 69  72 73 74 20 73 69 67 68  |nd at first sigh|
00000520  74 20 49 0d 74 68 6f 75  67 68 74 20 73 68 65 20  |t I.thought she |
00000530  68 61 64 20 61 20 70 69  65 63 65 20 6f 66 20 77  |had a piece of w|
00000540  6f 72 6b 20 74 68 61 74  20 77 6f 75 6c 64 20 74  |ork that would t|
00000550  61 6b 65 20 61 20 6c 69  66 65 20 74 69 6d 65 2e  |ake a life time.|
00000560  20 49 20 63 6f 75 6c 64  0d 69 6d 61 67 69 6e 65  | I could.imagine|
00000570  20 68 65 72 20 61 74 20  36 30 20 73 74 69 6c 6c  | her at 60 still|
00000580  20 77 6f 72 6b 69 6e 67  20 6f 75 74 20 32 33 38  | working out 238|
00000590  39 37 20 74 69 6d 65 73  20 31 2c 20 32 33 38 39  |97 times 1, 2389|
000005a0  37 20 74 69 6d 65 73 20  32 2e 20 53 6f 20 49 0d  |7 times 2. So I.|
000005b0  74 68 6f 75 67 68 74 20  74 68 61 74 20 61 20 70  |thought that a p|
000005c0  72 6f 67 72 61 6d 20 74  6f 20 64 6f 20 74 68 65  |rogram to do the|
000005d0  20 63 61 6c 63 75 6c 61  74 69 6f 6e 73 20 77 6f  | calculations wo|
000005e0  75 6c 64 20 62 65 20 75  73 65 66 75 6c 2c 20 61  |uld be useful, a|
000005f0  73 20 65 76 65 6e 0d 75  73 69 6e 67 20 61 20 63  |s even.using a c|
00000600  61 6c 63 75 6c 61 74 6f  72 20 77 6f 75 6c 64 20  |alculator would |
00000610  6d 65 61 6e 20 65 6e 74  65 72 69 6e 67 20 65 61  |mean entering ea|
00000620  63 68 20 73 75 6d 20 6f  6e 65 20 61 74 20 61 20  |ch sum one at a |
00000630  74 69 6d 65 2e 0d 0d 53  6f 20 49 20 74 6f 6f 6b  |time...So I took|
00000640  20 6f 6e 20 74 68 65 20  74 61 73 6b 20 6f 66 20  | on the task of |
00000650  75 74 69 6c 69 73 69 6e  67 20 74 68 65 20 63 6f  |utilising the co|
00000660  6d 70 75 74 65 72 73 20  67 72 61 70 68 69 63 73  |mputers graphics|
00000670  20 66 61 63 69 6c 69 74  69 65 73 20 61 6e 64 0d  | facilities and.|
00000680  70 72 6f 64 75 63 65 64  20 74 68 69 73 20 70 72  |produced this pr|
00000690  6f 67 72 61 6d 2c 20 77  69 74 68 20 73 75 72 70  |ogram, with surp|
000006a0  72 69 73 69 6e 67 20 72  65 73 75 6c 74 73 2e 20  |rising results. |
000006b0  54 72 79 20 69 74 20 79  6f 75 72 73 65 6c 66 2c  |Try it yourself,|
000006c0  20 63 75 72 69 6f 75 73  0d 69 73 6e 27 74 20 69  | curious.isn't i|
000006d0  74 21 0d 0d 44 75 65 20  74 6f 20 74 68 65 20 63  |t!..Due to the c|
000006e0  6f 6d 70 75 74 65 72 20  73 63 72 65 65 6e 20 70  |omputer screen p|
000006f0  69 78 65 6c 73 20 6e 6f  74 20 62 65 69 6e 67 20  |ixels not being |
00000700  73 71 75 61 72 65 20 74  68 65 72 65 20 6d 61 79  |square there may|
00000710  20 62 65 20 73 6f 6d 65  0d 73 6c 69 67 68 74 20  | be some.slight |
00000720  64 69 73 74 6f 72 74 69  6f 6e 20 6f 66 20 74 68  |distortion of th|
00000730  65 20 70 61 74 74 65 72  6e 73 2e 20 54 68 69 73  |e patterns. This|
00000740  20 69 73 20 62 65 73 74  20 73 65 65 6e 20 77 68  | is best seen wh|
00000750  65 6e 20 70 72 6f 63 65  73 73 69 6e 67 0d 74 68  |en processing.th|
00000760  65 20 39 20 74 69 6d 65  73 20 74 61 62 6c 65 2e  |e 9 times table.|
00000770  20 54 68 65 20 72 65 73  75 6c 74 20 73 68 6f 75  | The result shou|
00000780  6c 64 20 62 65 20 61 20  70 65 72 66 65 63 74 20  |ld be a perfect |
00000790  73 71 75 61 72 65 2e 0d  0d 54 68 65 20 70 72 6f  |square...The pro|
000007a0  67 72 61 6d 20 69 73 20  77 72 69 74 74 65 6e 20  |gram is written |
000007b0  74 6f 20 61 6c 6c 6f 77  20 74 68 65 20 65 61 73  |to allow the eas|
000007c0  79 20 61 64 64 69 74 69  6f 6e 20 6f 66 20 61 6e  |y addition of an|
000007d0  79 20 72 65 66 69 6e 65  6d 65 6e 74 73 20 6f 66  |y refinements of|
000007e0  0d 79 6f 75 72 20 6f 77  6e 2c 20 73 75 63 68 20  |.your own, such |
000007f0  61 73 20 73 63 72 65 65  6e 20 70 72 69 6e 74 20  |as screen print |
00000800  72 6f 75 74 69 6e 65 73  20 61 6e 64 20 73 6f 20  |routines and so |
00000810  6f 6e 2e 0d                                       |on..|
00000814
25-08-89/T\Curio.m0
25-08-89/T\Curio.m1
25-08-89/T\Curio.m2
25-08-89/T\Curio.m4
25-08-89/T\Curio.m5