Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_34.ADF » P/+mtext2
P/+mtext2
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 » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_34.ADF |
Filename: | P/+mtext2 |
Read OK: | ✔ |
File size: | 1672 bytes |
Load address: | 2B206576 |
Exec address: | 7865746D |
File contents
10 MODE4 20 FOR A=2 TO 6:PRINTTAB(1,A)STRING$(39,"_"):NEXT That's one staff drawn. The notes need to be defined and for this we need to resort to some paper. Or you may have a character defining program. I have one somewhere, I'll take a look at it and see if it can be published in EUG. Draw a grid, 8 x 8 boxes. fill in the boxes which will make the shape you want. Now working horizontaly, the first box has a value of 128, the 2ed = 64, the 3rd = 32, 4th = 16, 5th = 8, 6th = 4, 7th = 2 and 8th = 1. Start from the first horizontal row at the top. check which boxes have been filled in and add those values together. ________________________________ |___|___|___|___|___|___|_ _|___| no boxes = 0 |___|___|___|_X_|_X_|___|___|___| 4th and 5th = 16+8=24 |___|___|_X_|___|___|_X_|___|___| 3rd and 6th = 32+4=36 |___|_X_|___|___|___|___|_X_|___| 2ed and 7th = 64+2=66 |___|_X_|___|___|___|___|_X_|___| 2ed and 7th = 64+2=66 |___|___|_X_|___|___|_X_|___|___| 3rd and 6th = 32+4=36 |___|___|___|_X_|_X_|___|___|___| 4th and 5th = 16+8=36 |___|___|___|___|___|___|___|___| no boxes = 0 128 64 32 16 8 4 2 1 Now type in VDU23,224, 0 , 24, 36, 66, 66, 36, 36, 0 1st,2ed,3rd,4th,5th,6th,7th,8th Check the character by typing PRINT CHR$226 <ret> These numbers are different from those used for this character in the program, these numbers were used for clarity. The number after 24 in this case 226 is the ASCII code for the character just defined. You can use any number between 224 and 255 so the next character you define might be VDU24,225,ect.. To call this character I used a procedure. DEF PROCs(h,v):PRINTTAB(h,v)CHR$226:ENDPROC DEF means define a procedure or function. Immediately following DEF comes the name of the procedure PROCs. In this case PROCs is followed by two variables within brackets. When this procedure is called the call will include definations for these two variables. The procedure itself is simply a PRINTTAB statement, the parameters for PRINTTAB are the variables sent by the procedure call. Remenber in a PRINTTAB statement, two numbers must be included which will dictate the horizontal and vertical position on the screen of where the character to be printed is to be. This character is fine for between the lines F, A, C, and E but for the notes on the lines we need something else. If we define 2 semicircles, one facing up, the other facing down, then program them to be placed into position together the effect will be acheved. This is a lot easier that you might think. The characters were defined as CHR$224 for the lower half of the circle and CHR$225 for the upper half. I'm not going to describe again how a character is defined but for the lower semicircle the cup side sits on the top row of the grid and the curve sits 3 rows down. The other semicircle ofcourse is the exact opposite. VDU24,224,66,66,60,0,0,0,0,0 and VDU24,225,0,0,0,0,0,60,66,66 The procedure was defined as: DEF PROCl(h,v,v1):PRINTTAB(h,v)CHR$225:PRINTTAB(h,v1)CHR$224:ENDPROC Here the procedure name had three variables, h,v and v1. In the PRINTTAB statements both shared h which is the horizontal position but one used v for its vertical while the other used v1. The a%=INSTR( line which was used above and in the EUG menu is used in this program. This line has a REPEAT UNTIL loop, the REPEAT is before a%=INSTR( and UNTIL is at the end. The loop will cycle indefinately so that when a key is pressed, the relevant action is taken then the cycle will continue testing for another key press and so on. The procedures are called by: IF a%=1PROCl(h%,v%,(v%+1)):c%=88 c% is the value for the pitch in the SOUND command. Now I said that when the procedure is called it will include values for the variables defined in the procedure name. What I've done here is to use other variables to define those variables. The reason is that when this key is pressed it will place a character (2 in fact, this note sits on a line) onto the staff in a particular place. But the next note will need to be further along so the TAB positions will need to be altered each time. This is done by using some surprisingly simple arithmetic to produce the values h% and v%. The third value is simply v% with 1 added. h% is the number of spaces away from the left hand side of the screen. It must change by 2 each time and also if the right hand side of the screen is reached it will need to be brought back to the start. h% will take the printing down to the next staff. I defined another variable to take care of h% and v%. Surprisingly it's called b%. Initially b% was given the value 0 from outside the REPEAT UNTIL loop. It will keep this value until the end of the loop a line: b%=b%+2 will add 2 to it. It won't get to the end of the loop until a key has been pressed. So for the first key press b% will = 0, for the second b% will = 2 and so on. Back at the start of the loop were 3 lines: IF b%<38v%=a%:ELSE v%=a%+8 IF b%>75v%=a%+16 IF b%>112END b% will be less than 38 while printing on the first staff. So here v% will be equal to a%. So in the example line printed above the second two v% variables (h%,v%,(v%+1)) will equal 1 and 2. If b% was more than 38 v% would be equal to a% plus 8, so in our example a%=1, a%+8=9. v%=9 v%+1=10. This is to print onto the second staff. If b% was more than 75 v% would be equal to a%+16 Now there is an important point here. Pressing the first key, a%=1 so the vertical printing positions will be 1 for the top half and 2 for the bottom. Pressing the second key a%=2 so the vertical printing positions will be 2 for the top half anf 3 for the bottom.
00000000 0d 31 30 20 4d 4f 44 45 34 0d 32 30 20 46 4f 52 |.10 MODE4.20 FOR| 00000010 20 41 3d 32 20 54 4f 20 36 3a 50 52 49 4e 54 54 | A=2 TO 6:PRINTT| 00000020 41 42 28 31 2c 41 29 53 54 52 49 4e 47 24 28 33 |AB(1,A)STRING$(3| 00000030 39 2c 22 5f 22 29 3a 4e 45 58 54 0d 0d 54 68 61 |9,"_"):NEXT..Tha| 00000040 74 27 73 20 6f 6e 65 20 73 74 61 66 66 20 64 72 |t's one staff dr| 00000050 61 77 6e 2e 20 54 68 65 20 6e 6f 74 65 73 20 6e |awn. The notes n| 00000060 65 65 64 20 74 6f 20 62 65 20 64 65 66 69 6e 65 |eed to be define| 00000070 64 20 61 6e 64 20 66 6f 72 20 74 68 69 73 20 20 |d and for this | 00000080 77 65 20 6e 65 65 64 0d 74 6f 20 72 65 73 6f 72 |we need.to resor| 00000090 74 20 74 6f 20 73 6f 6d 65 20 70 61 70 65 72 2e |t to some paper.| 000000a0 20 4f 72 20 79 6f 75 20 6d 61 79 20 68 61 76 65 | Or you may have| 000000b0 20 61 20 63 68 61 72 61 63 74 65 72 20 64 65 66 | a character def| 000000c0 69 6e 69 6e 67 20 70 72 6f 67 72 61 6d 2e 20 49 |ining program. I| 000000d0 0d 68 61 76 65 20 6f 6e 65 20 73 6f 6d 65 77 68 |.have one somewh| 000000e0 65 72 65 2c 20 49 27 6c 6c 20 74 61 6b 65 20 61 |ere, I'll take a| 000000f0 20 6c 6f 6f 6b 20 61 74 20 69 74 20 61 6e 64 20 | look at it and | 00000100 73 65 65 20 69 66 20 69 74 20 63 61 6e 20 62 65 |see if it can be| 00000110 20 70 75 62 6c 69 73 68 65 64 0d 69 6e 20 45 55 | published.in EU| 00000120 47 2e 0d 0d 44 72 61 77 20 61 20 67 72 69 64 2c |G...Draw a grid,| 00000130 20 38 20 78 20 38 20 62 6f 78 65 73 2e 20 66 69 | 8 x 8 boxes. fi| 00000140 6c 6c 20 69 6e 20 74 68 65 20 62 6f 78 65 73 20 |ll in the boxes | 00000150 77 68 69 63 68 20 77 69 6c 6c 20 6d 61 6b 65 20 |which will make | 00000160 74 68 65 20 73 68 61 70 65 20 79 6f 75 0d 77 61 |the shape you.wa| 00000170 6e 74 2e 20 4e 6f 77 20 77 6f 72 6b 69 6e 67 20 |nt. Now working | 00000180 68 6f 72 69 7a 6f 6e 74 61 6c 79 2c 20 74 68 65 |horizontaly, the| 00000190 20 66 69 72 73 74 20 62 6f 78 20 68 61 73 20 61 | first box has a| 000001a0 20 76 61 6c 75 65 20 6f 66 20 31 32 38 2c 20 74 | value of 128, t| 000001b0 68 65 20 32 65 64 20 3d 0d 36 34 2c 20 74 68 65 |he 2ed =.64, the| 000001c0 20 33 72 64 20 3d 20 33 32 2c 20 34 74 68 20 3d | 3rd = 32, 4th =| 000001d0 20 31 36 2c 20 35 74 68 20 3d 20 38 2c 20 36 74 | 16, 5th = 8, 6t| 000001e0 68 20 3d 20 34 2c 20 37 74 68 20 3d 20 32 20 61 |h = 4, 7th = 2 a| 000001f0 6e 64 20 38 74 68 20 3d 20 31 2e 0d 0d 53 74 61 |nd 8th = 1...Sta| 00000200 72 74 20 66 72 6f 6d 20 74 68 65 20 66 69 72 73 |rt from the firs| 00000210 74 20 68 6f 72 69 7a 6f 6e 74 61 6c 20 72 6f 77 |t horizontal row| 00000220 20 61 74 20 74 68 65 20 74 6f 70 2e 20 63 68 65 | at the top. che| 00000230 63 6b 20 77 68 69 63 68 20 62 6f 78 65 73 20 68 |ck which boxes h| 00000240 61 76 65 0d 62 65 65 6e 20 66 69 6c 6c 65 64 20 |ave.been filled | 00000250 69 6e 20 61 6e 64 20 61 64 64 20 74 68 6f 73 65 |in and add those| 00000260 20 76 61 6c 75 65 73 20 74 6f 67 65 74 68 65 72 | values together| 00000270 2e 20 0d 0d 20 20 20 20 20 20 20 20 20 5f 5f 5f |. .. ___| 00000280 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f |________________| 00000290 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 0d 20 20 |_____________. | 000002a0 20 20 20 20 20 20 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f | |___|___|_| 000002b0 5f 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f |__|___|___|___|_| 000002c0 20 5f 7c 5f 5f 5f 7c 20 6e 6f 20 62 6f 78 65 73 | _|___| no boxes| 000002d0 20 3d 20 30 0d 20 20 20 20 20 20 20 20 7c 5f 5f | = 0. |__| 000002e0 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 58 5f 7c 5f 58 |_|___|___|_X_|_X| 000002f0 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 20 34 |_|___|___|___| 4| 00000300 74 68 20 61 6e 64 20 35 74 68 20 3d 20 31 36 2b |th and 5th = 16+| 00000310 38 3d 32 34 0d 20 20 20 20 20 20 20 20 7c 5f 5f |8=24. |__| 00000320 5f 7c 5f 5f 5f 7c 5f 58 5f 7c 5f 5f 5f 7c 5f 5f |_|___|_X_|___|__| 00000330 5f 7c 5f 58 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 20 33 |_|_X_|___|___| 3| 00000340 72 64 20 61 6e 64 20 36 74 68 20 3d 20 33 32 2b |rd and 6th = 32+| 00000350 34 3d 33 36 0d 20 20 20 20 20 20 20 20 7c 5f 5f |4=36. |__| 00000360 5f 7c 5f 58 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 5f |_|_X_|___|___|__| 00000370 5f 7c 5f 5f 5f 7c 5f 58 5f 7c 5f 5f 5f 7c 20 32 |_|___|_X_|___| 2| 00000380 65 64 20 61 6e 64 20 37 74 68 20 3d 20 36 34 2b |ed and 7th = 64+| 00000390 32 3d 36 36 0d 20 20 20 20 20 20 20 20 7c 5f 5f |2=66. |__| 000003a0 5f 7c 5f 58 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 5f |_|_X_|___|___|__| 000003b0 5f 7c 5f 5f 5f 7c 5f 58 5f 7c 5f 5f 5f 7c 20 32 |_|___|_X_|___| 2| 000003c0 65 64 20 61 6e 64 20 37 74 68 20 3d 20 36 34 2b |ed and 7th = 64+| 000003d0 32 3d 36 36 0d 20 20 20 20 20 20 20 20 7c 5f 5f |2=66. |__| 000003e0 5f 7c 5f 5f 5f 7c 5f 58 5f 7c 5f 5f 5f 7c 5f 5f |_|___|_X_|___|__| 000003f0 5f 7c 5f 58 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 20 33 |_|_X_|___|___| 3| 00000400 72 64 20 61 6e 64 20 36 74 68 20 3d 20 33 32 2b |rd and 6th = 32+| 00000410 34 3d 33 36 0d 20 20 20 20 20 20 20 20 7c 5f 5f |4=36. |__| 00000420 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 58 5f 7c 5f 58 |_|___|___|_X_|_X| 00000430 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 20 34 |_|___|___|___| 4| 00000440 74 68 20 61 6e 64 20 35 74 68 20 3d 20 31 36 2b |th and 5th = 16+| 00000450 38 3d 33 36 0d 20 20 20 20 20 20 20 20 7c 5f 5f |8=36. |__| 00000460 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 5f |_|___|___|___|__| 00000470 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 5f 5f 5f 7c 20 6e |_|___|___|___| n| 00000480 6f 20 62 6f 78 65 73 20 3d 20 30 0d 20 20 20 20 |o boxes = 0. | 00000490 20 20 20 20 20 31 32 38 20 20 36 34 20 20 33 32 | 128 64 32| 000004a0 20 20 31 36 20 20 38 20 20 20 34 20 20 20 32 20 | 16 8 4 2 | 000004b0 20 20 31 0d 0d 4e 6f 77 20 74 79 70 65 20 69 6e | 1..Now type in| 000004c0 20 56 44 55 32 33 2c 32 32 34 2c 20 30 20 2c 20 | VDU23,224, 0 , | 000004d0 32 34 2c 20 33 36 2c 20 36 36 2c 20 36 36 2c 20 |24, 36, 66, 66, | 000004e0 33 36 2c 20 33 36 2c 20 30 0d 20 20 20 20 20 20 |36, 36, 0. | 000004f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000500 31 73 74 2c 32 65 64 2c 33 72 64 2c 34 74 68 2c |1st,2ed,3rd,4th,| 00000510 35 74 68 2c 36 74 68 2c 37 74 68 2c 38 74 68 0d |5th,6th,7th,8th.| 00000520 0d 43 68 65 63 6b 20 74 68 65 20 63 68 61 72 61 |.Check the chara| 00000530 63 74 65 72 20 62 79 20 74 79 70 69 6e 67 20 50 |cter by typing P| 00000540 52 49 4e 54 20 43 48 52 24 32 32 36 20 3c 72 65 |RINT CHR$226 <re| 00000550 74 3e 0d 0d 54 68 65 73 65 20 6e 75 6d 62 65 72 |t>..These number| 00000560 73 20 61 72 65 20 64 69 66 66 65 72 65 6e 74 20 |s are different | 00000570 66 72 6f 6d 20 74 68 6f 73 65 20 75 73 65 64 20 |from those used | 00000580 66 6f 72 20 74 68 69 73 20 63 68 61 72 61 63 74 |for this charact| 00000590 65 72 20 69 6e 20 74 68 65 0d 70 72 6f 67 72 61 |er in the.progra| 000005a0 6d 2c 20 74 68 65 73 65 20 6e 75 6d 62 65 72 73 |m, these numbers| 000005b0 20 77 65 72 65 20 75 73 65 64 20 66 6f 72 20 63 | were used for c| 000005c0 6c 61 72 69 74 79 2e 0d 0d 54 68 65 20 6e 75 6d |larity...The num| 000005d0 62 65 72 20 61 66 74 65 72 20 32 34 20 69 6e 20 |ber after 24 in | 000005e0 74 68 69 73 20 63 61 73 65 20 32 32 36 20 69 73 |this case 226 is| 000005f0 20 74 68 65 20 41 53 43 49 49 20 63 6f 64 65 20 | the ASCII code | 00000600 66 6f 72 20 74 68 65 20 63 68 61 72 61 63 74 65 |for the characte| 00000610 72 0d 6a 75 73 74 20 64 65 66 69 6e 65 64 2e 20 |r.just defined. | 00000620 59 6f 75 20 63 61 6e 20 75 73 65 20 61 6e 79 20 |You can use any | 00000630 6e 75 6d 62 65 72 20 62 65 74 77 65 65 6e 20 32 |number between 2| 00000640 32 34 20 61 6e 64 20 32 35 35 20 73 6f 20 74 68 |24 and 255 so th| 00000650 65 20 6e 65 78 74 0d 63 68 61 72 61 63 74 65 72 |e next.character| 00000660 20 79 6f 75 20 64 65 66 69 6e 65 20 6d 69 67 68 | you define migh| 00000670 74 20 62 65 20 56 44 55 32 34 2c 32 32 35 2c 65 |t be VDU24,225,e| 00000680 63 74 2e 2e 0d 0d 54 6f 20 63 61 6c 6c 20 74 68 |ct....To call th| 00000690 69 73 20 63 68 61 72 61 63 74 65 72 20 49 20 75 |is character I u| 000006a0 73 65 64 20 61 20 70 72 6f 63 65 64 75 72 65 2e |sed a procedure.| 000006b0 0d 0d 44 45 46 20 50 52 4f 43 73 28 68 2c 76 29 |..DEF PROCs(h,v)| 000006c0 3a 50 52 49 4e 54 54 41 42 28 68 2c 76 29 43 48 |:PRINTTAB(h,v)CH| 000006d0 52 24 32 32 36 3a 45 4e 44 50 52 4f 43 0d 0d 44 |R$226:ENDPROC..D| 000006e0 45 46 20 6d 65 61 6e 73 20 64 65 66 69 6e 65 20 |EF means define | 000006f0 61 20 70 72 6f 63 65 64 75 72 65 20 6f 72 20 66 |a procedure or f| 00000700 75 6e 63 74 69 6f 6e 2e 20 49 6d 6d 65 64 69 61 |unction. Immedia| 00000710 74 65 6c 79 20 66 6f 6c 6c 6f 77 69 6e 67 20 44 |tely following D| 00000720 45 46 20 63 6f 6d 65 73 0d 74 68 65 20 6e 61 6d |EF comes.the nam| 00000730 65 20 6f 66 20 74 68 65 20 70 72 6f 63 65 64 75 |e of the procedu| 00000740 72 65 20 50 52 4f 43 73 2e 20 49 6e 20 74 68 69 |re PROCs. In thi| 00000750 73 20 63 61 73 65 20 50 52 4f 43 73 20 69 73 20 |s case PROCs is | 00000760 66 6f 6c 6c 6f 77 65 64 20 62 79 20 74 77 6f 0d |followed by two.| 00000770 76 61 72 69 61 62 6c 65 73 20 77 69 74 68 69 6e |variables within| 00000780 20 62 72 61 63 6b 65 74 73 2e 20 57 68 65 6e 20 | brackets. When | 00000790 74 68 69 73 20 70 72 6f 63 65 64 75 72 65 20 69 |this procedure i| 000007a0 73 20 63 61 6c 6c 65 64 20 74 68 65 20 63 61 6c |s called the cal| 000007b0 6c 20 77 69 6c 6c 0d 69 6e 63 6c 75 64 65 20 64 |l will.include d| 000007c0 65 66 69 6e 61 74 69 6f 6e 73 20 66 6f 72 20 74 |efinations for t| 000007d0 68 65 73 65 20 74 77 6f 20 76 61 72 69 61 62 6c |hese two variabl| 000007e0 65 73 2e 20 54 68 65 20 70 72 6f 63 65 64 75 72 |es. The procedur| 000007f0 65 20 69 74 73 65 6c 66 20 69 73 0d 73 69 6d 70 |e itself is.simp| 00000800 6c 79 20 61 20 50 52 49 4e 54 54 41 42 20 73 74 |ly a PRINTTAB st| 00000810 61 74 65 6d 65 6e 74 2c 20 74 68 65 20 70 61 72 |atement, the par| 00000820 61 6d 65 74 65 72 73 20 66 6f 72 20 50 52 49 4e |ameters for PRIN| 00000830 54 54 41 42 20 61 72 65 20 74 68 65 20 76 61 72 |TTAB are the var| 00000840 69 61 62 6c 65 73 0d 73 65 6e 74 20 62 79 20 74 |iables.sent by t| 00000850 68 65 20 70 72 6f 63 65 64 75 72 65 20 63 61 6c |he procedure cal| 00000860 6c 2e 20 52 65 6d 65 6e 62 65 72 20 69 6e 20 61 |l. Remenber in a| 00000870 20 50 52 49 4e 54 54 41 42 20 73 74 61 74 65 6d | PRINTTAB statem| 00000880 65 6e 74 2c 20 74 77 6f 20 6e 75 6d 62 65 72 73 |ent, two numbers| 00000890 0d 6d 75 73 74 20 62 65 20 69 6e 63 6c 75 64 65 |.must be include| 000008a0 64 20 77 68 69 63 68 20 77 69 6c 6c 20 64 69 63 |d which will dic| 000008b0 74 61 74 65 20 74 68 65 20 68 6f 72 69 7a 6f 6e |tate the horizon| 000008c0 74 61 6c 20 61 6e 64 20 76 65 72 74 69 63 61 6c |tal and vertical| 000008d0 20 70 6f 73 69 74 69 6f 6e 0d 6f 6e 20 74 68 65 | position.on the| 000008e0 20 73 63 72 65 65 6e 20 6f 66 20 77 68 65 72 65 | screen of where| 000008f0 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 74 | the character t| 00000900 6f 20 62 65 20 70 72 69 6e 74 65 64 20 69 73 20 |o be printed is | 00000910 74 6f 20 62 65 2e 0d 0d 54 68 69 73 20 63 68 61 |to be...This cha| 00000920 72 61 63 74 65 72 20 69 73 20 66 69 6e 65 20 66 |racter is fine f| 00000930 6f 72 20 62 65 74 77 65 65 6e 20 74 68 65 20 6c |or between the l| 00000940 69 6e 65 73 20 46 2c 20 41 2c 20 43 2c 20 61 6e |ines F, A, C, an| 00000950 64 20 45 20 62 75 74 20 66 6f 72 20 74 68 65 0d |d E but for the.| 00000960 6e 6f 74 65 73 20 6f 6e 20 74 68 65 20 6c 69 6e |notes on the lin| 00000970 65 73 20 77 65 20 6e 65 65 64 20 73 6f 6d 65 74 |es we need somet| 00000980 68 69 6e 67 20 65 6c 73 65 2e 20 49 66 20 77 65 |hing else. If we| 00000990 20 64 65 66 69 6e 65 20 32 20 73 65 6d 69 63 69 | define 2 semici| 000009a0 72 63 6c 65 73 2c 20 6f 6e 65 0d 66 61 63 69 6e |rcles, one.facin| 000009b0 67 20 75 70 2c 20 74 68 65 20 6f 74 68 65 72 20 |g up, the other | 000009c0 66 61 63 69 6e 67 20 64 6f 77 6e 2c 20 74 68 65 |facing down, the| 000009d0 6e 20 70 72 6f 67 72 61 6d 20 74 68 65 6d 20 74 |n program them t| 000009e0 6f 20 62 65 20 70 6c 61 63 65 64 20 69 6e 74 6f |o be placed into| 000009f0 0d 70 6f 73 69 74 69 6f 6e 20 74 6f 67 65 74 68 |.position togeth| 00000a00 65 72 20 74 68 65 20 65 66 66 65 63 74 20 77 69 |er the effect wi| 00000a10 6c 6c 20 62 65 20 61 63 68 65 76 65 64 2e 20 0d |ll be acheved. .| 00000a20 0d 54 68 69 73 20 69 73 20 61 20 6c 6f 74 20 65 |.This is a lot e| 00000a30 61 73 69 65 72 20 74 68 61 74 20 79 6f 75 20 6d |asier that you m| 00000a40 69 67 68 74 20 74 68 69 6e 6b 2e 0d 0d 54 68 65 |ight think...The| 00000a50 20 63 68 61 72 61 63 74 65 72 73 20 77 65 72 65 | characters were| 00000a60 20 64 65 66 69 6e 65 64 20 61 73 20 43 48 52 24 | defined as CHR$| 00000a70 32 32 34 20 66 6f 72 20 74 68 65 20 6c 6f 77 65 |224 for the lowe| 00000a80 72 20 68 61 6c 66 20 6f 66 20 74 68 65 20 63 69 |r half of the ci| 00000a90 72 63 6c 65 0d 61 6e 64 20 43 48 52 24 32 32 35 |rcle.and CHR$225| 00000aa0 20 66 6f 72 20 74 68 65 20 75 70 70 65 72 20 68 | for the upper h| 00000ab0 61 6c 66 2e 0d 0d 49 27 6d 20 6e 6f 74 20 67 6f |alf...I'm not go| 00000ac0 69 6e 67 20 74 6f 20 64 65 73 63 72 69 62 65 20 |ing to describe | 00000ad0 61 67 61 69 6e 20 68 6f 77 20 61 20 63 68 61 72 |again how a char| 00000ae0 61 63 74 65 72 20 69 73 20 64 65 66 69 6e 65 64 |acter is defined| 00000af0 20 62 75 74 20 66 6f 72 20 74 68 65 0d 6c 6f 77 | but for the.low| 00000b00 65 72 20 73 65 6d 69 63 69 72 63 6c 65 20 74 68 |er semicircle th| 00000b10 65 20 63 75 70 20 73 69 64 65 20 73 69 74 73 20 |e cup side sits | 00000b20 6f 6e 20 74 68 65 20 74 6f 70 20 72 6f 77 20 6f |on the top row o| 00000b30 66 20 74 68 65 20 67 72 69 64 20 61 6e 64 20 74 |f the grid and t| 00000b40 68 65 0d 63 75 72 76 65 20 73 69 74 73 20 33 20 |he.curve sits 3 | 00000b50 72 6f 77 73 20 64 6f 77 6e 2e 20 54 68 65 20 6f |rows down. The o| 00000b60 74 68 65 72 20 73 65 6d 69 63 69 72 63 6c 65 20 |ther semicircle | 00000b70 6f 66 63 6f 75 72 73 65 20 69 73 20 74 68 65 20 |ofcourse is the | 00000b80 65 78 61 63 74 0d 6f 70 70 6f 73 69 74 65 2e 0d |exact.opposite..| 00000b90 0d 56 44 55 32 34 2c 32 32 34 2c 36 36 2c 36 36 |.VDU24,224,66,66| 00000ba0 2c 36 30 2c 30 2c 30 2c 30 2c 30 2c 30 20 61 6e |,60,0,0,0,0,0 an| 00000bb0 64 20 56 44 55 32 34 2c 32 32 35 2c 30 2c 30 2c |d VDU24,225,0,0,| 00000bc0 30 2c 30 2c 30 2c 36 30 2c 36 36 2c 36 36 0d 0d |0,0,0,60,66,66..| 00000bd0 54 68 65 20 70 72 6f 63 65 64 75 72 65 20 77 61 |The procedure wa| 00000be0 73 20 64 65 66 69 6e 65 64 20 61 73 3a 0d 0d 44 |s defined as:..D| 00000bf0 45 46 20 50 52 4f 43 6c 28 68 2c 76 2c 76 31 29 |EF PROCl(h,v,v1)| 00000c00 3a 50 52 49 4e 54 54 41 42 28 68 2c 76 29 43 48 |:PRINTTAB(h,v)CH| 00000c10 52 24 32 32 35 3a 50 52 49 4e 54 54 41 42 28 68 |R$225:PRINTTAB(h| 00000c20 2c 76 31 29 43 48 52 24 32 32 34 3a 45 4e 44 50 |,v1)CHR$224:ENDP| 00000c30 52 4f 43 0d 0d 48 65 72 65 20 74 68 65 20 70 72 |ROC..Here the pr| 00000c40 6f 63 65 64 75 72 65 20 6e 61 6d 65 20 68 61 64 |ocedure name had| 00000c50 20 74 68 72 65 65 20 76 61 72 69 61 62 6c 65 73 | three variables| 00000c60 2c 20 68 2c 76 20 20 61 6e 64 20 76 31 2e 20 49 |, h,v and v1. I| 00000c70 6e 20 74 68 65 20 50 52 49 4e 54 54 41 42 0d 73 |n the PRINTTAB.s| 00000c80 74 61 74 65 6d 65 6e 74 73 20 62 6f 74 68 20 73 |tatements both s| 00000c90 68 61 72 65 64 20 68 20 77 68 69 63 68 20 69 73 |hared h which is| 00000ca0 20 74 68 65 20 68 6f 72 69 7a 6f 6e 74 61 6c 20 | the horizontal | 00000cb0 70 6f 73 69 74 69 6f 6e 20 62 75 74 20 6f 6e 65 |position but one| 00000cc0 20 75 73 65 64 20 76 0d 66 6f 72 20 69 74 73 20 | used v.for its | 00000cd0 76 65 72 74 69 63 61 6c 20 77 68 69 6c 65 20 74 |vertical while t| 00000ce0 68 65 20 6f 74 68 65 72 20 75 73 65 64 20 76 31 |he other used v1| 00000cf0 2e 0d 0d 54 68 65 20 61 25 3d 49 4e 53 54 52 28 |...The a%=INSTR(| 00000d00 20 6c 69 6e 65 20 77 68 69 63 68 20 77 61 73 20 | line which was | 00000d10 75 73 65 64 20 61 62 6f 76 65 20 61 6e 64 20 69 |used above and i| 00000d20 6e 20 74 68 65 20 45 55 47 20 6d 65 6e 75 20 69 |n the EUG menu i| 00000d30 73 20 75 73 65 64 20 69 6e 0d 74 68 69 73 20 70 |s used in.this p| 00000d40 72 6f 67 72 61 6d 2e 20 54 68 69 73 20 6c 69 6e |rogram. This lin| 00000d50 65 20 68 61 73 20 61 20 52 45 50 45 41 54 20 55 |e has a REPEAT U| 00000d60 4e 54 49 4c 20 6c 6f 6f 70 2c 20 74 68 65 20 52 |NTIL loop, the R| 00000d70 45 50 45 41 54 20 69 73 20 62 65 66 6f 72 65 0d |EPEAT is before.| 00000d80 61 25 3d 49 4e 53 54 52 28 20 61 6e 64 20 55 4e |a%=INSTR( and UN| 00000d90 54 49 4c 20 69 73 20 61 74 20 74 68 65 20 65 6e |TIL is at the en| 00000da0 64 2e 20 54 68 65 20 6c 6f 6f 70 20 77 69 6c 6c |d. The loop will| 00000db0 20 63 79 63 6c 65 20 69 6e 64 65 66 69 6e 61 74 | cycle indefinat| 00000dc0 65 6c 79 20 73 6f 0d 74 68 61 74 20 77 68 65 6e |ely so.that when| 00000dd0 20 61 20 6b 65 79 20 69 73 20 70 72 65 73 73 65 | a key is presse| 00000de0 64 2c 20 74 68 65 20 72 65 6c 65 76 61 6e 74 20 |d, the relevant | 00000df0 61 63 74 69 6f 6e 20 69 73 20 74 61 6b 65 6e 20 |action is taken | 00000e00 74 68 65 6e 20 74 68 65 20 63 79 63 6c 65 0d 77 |then the cycle.w| 00000e10 69 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 74 65 73 |ill continue tes| 00000e20 74 69 6e 67 20 66 6f 72 20 61 6e 6f 74 68 65 72 |ting for another| 00000e30 20 6b 65 79 20 70 72 65 73 73 20 61 6e 64 20 73 | key press and s| 00000e40 6f 20 6f 6e 2e 0d 0d 54 68 65 20 70 72 6f 63 65 |o on...The proce| 00000e50 64 75 72 65 73 20 61 72 65 20 63 61 6c 6c 65 64 |dures are called| 00000e60 20 62 79 3a 0d 0d 49 46 20 61 25 3d 31 50 52 4f | by:..IF a%=1PRO| 00000e70 43 6c 28 68 25 2c 76 25 2c 28 76 25 2b 31 29 29 |Cl(h%,v%,(v%+1))| 00000e80 3a 63 25 3d 38 38 0d 0d 63 25 20 69 73 20 74 68 |:c%=88..c% is th| 00000e90 65 20 76 61 6c 75 65 20 66 6f 72 20 74 68 65 20 |e value for the | 00000ea0 70 69 74 63 68 20 69 6e 20 74 68 65 20 53 4f 55 |pitch in the SOU| 00000eb0 4e 44 20 63 6f 6d 6d 61 6e 64 2e 0d 0d 4e 6f 77 |ND command...Now| 00000ec0 20 49 20 73 61 69 64 20 74 68 61 74 20 77 68 65 | I said that whe| 00000ed0 6e 20 74 68 65 20 70 72 6f 63 65 64 75 72 65 20 |n the procedure | 00000ee0 69 73 20 63 61 6c 6c 65 64 20 69 74 20 77 69 6c |is called it wil| 00000ef0 6c 20 69 6e 63 6c 75 64 65 20 76 61 6c 75 65 73 |l include values| 00000f00 20 66 6f 72 0d 74 68 65 20 76 61 72 69 61 62 6c | for.the variabl| 00000f10 65 73 20 64 65 66 69 6e 65 64 20 69 6e 20 74 68 |es defined in th| 00000f20 65 20 70 72 6f 63 65 64 75 72 65 20 6e 61 6d 65 |e procedure name| 00000f30 2e 20 57 68 61 74 20 49 27 76 65 20 64 6f 6e 65 |. What I've done| 00000f40 20 68 65 72 65 20 69 73 20 74 6f 20 75 73 65 0d | here is to use.| 00000f50 6f 74 68 65 72 20 76 61 72 69 61 62 6c 65 73 20 |other variables | 00000f60 74 6f 20 64 65 66 69 6e 65 20 74 68 6f 73 65 20 |to define those | 00000f70 76 61 72 69 61 62 6c 65 73 2e 20 54 68 65 20 72 |variables. The r| 00000f80 65 61 73 6f 6e 20 69 73 20 74 68 61 74 20 77 68 |eason is that wh| 00000f90 65 6e 20 74 68 69 73 0d 6b 65 79 20 69 73 20 70 |en this.key is p| 00000fa0 72 65 73 73 65 64 20 69 74 20 77 69 6c 6c 20 70 |ressed it will p| 00000fb0 6c 61 63 65 20 61 20 63 68 61 72 61 63 74 65 72 |lace a character| 00000fc0 20 28 32 20 69 6e 20 66 61 63 74 2c 20 74 68 69 | (2 in fact, thi| 00000fd0 73 20 6e 6f 74 65 20 73 69 74 73 20 6f 6e 20 61 |s note sits on a| 00000fe0 0d 6c 69 6e 65 29 20 6f 6e 74 6f 20 74 68 65 20 |.line) onto the | 00000ff0 73 74 61 66 66 20 69 6e 20 61 20 70 61 72 74 69 |staff in a parti| 00001000 63 75 6c 61 72 20 70 6c 61 63 65 2e 20 42 75 74 |cular place. But| 00001010 20 74 68 65 20 6e 65 78 74 20 6e 6f 74 65 20 77 | the next note w| 00001020 69 6c 6c 20 6e 65 65 64 20 74 6f 0d 62 65 20 66 |ill need to.be f| 00001030 75 72 74 68 65 72 20 61 6c 6f 6e 67 20 73 6f 20 |urther along so | 00001040 74 68 65 20 54 41 42 20 70 6f 73 69 74 69 6f 6e |the TAB position| 00001050 73 20 77 69 6c 6c 20 6e 65 65 64 20 74 6f 20 62 |s will need to b| 00001060 65 20 61 6c 74 65 72 65 64 20 65 61 63 68 20 74 |e altered each t| 00001070 69 6d 65 2e 0d 54 68 69 73 20 69 73 20 64 6f 6e |ime..This is don| 00001080 65 20 62 79 20 75 73 69 6e 67 20 73 6f 6d 65 20 |e by using some | 00001090 73 75 72 70 72 69 73 69 6e 67 6c 79 20 73 69 6d |surprisingly sim| 000010a0 70 6c 65 20 61 72 69 74 68 6d 65 74 69 63 20 74 |ple arithmetic t| 000010b0 6f 20 70 72 6f 64 75 63 65 20 74 68 65 0d 76 61 |o produce the.va| 000010c0 6c 75 65 73 20 68 25 20 61 6e 64 20 76 25 2e 20 |lues h% and v%. | 000010d0 54 68 65 20 74 68 69 72 64 20 76 61 6c 75 65 20 |The third value | 000010e0 69 73 20 73 69 6d 70 6c 79 20 76 25 20 77 69 74 |is simply v% wit| 000010f0 68 20 31 20 61 64 64 65 64 2e 0d 0d 68 25 20 69 |h 1 added...h% i| 00001100 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 |s the number of | 00001110 73 70 61 63 65 73 20 61 77 61 79 20 66 72 6f 6d |spaces away from| 00001120 20 74 68 65 20 6c 65 66 74 20 68 61 6e 64 20 73 | the left hand s| 00001130 69 64 65 20 6f 66 20 74 68 65 20 73 63 72 65 65 |ide of the scree| 00001140 6e 2e 20 49 74 0d 6d 75 73 74 20 63 68 61 6e 67 |n. It.must chang| 00001150 65 20 62 79 20 32 20 65 61 63 68 20 74 69 6d 65 |e by 2 each time| 00001160 20 61 6e 64 20 61 6c 73 6f 20 69 66 20 74 68 65 | and also if the| 00001170 20 72 69 67 68 74 20 68 61 6e 64 20 73 69 64 65 | right hand side| 00001180 20 6f 66 20 74 68 65 20 73 63 72 65 65 6e 0d 69 | of the screen.i| 00001190 73 20 72 65 61 63 68 65 64 20 69 74 20 77 69 6c |s reached it wil| 000011a0 6c 20 6e 65 65 64 20 74 6f 20 62 65 20 62 72 6f |l need to be bro| 000011b0 75 67 68 74 20 62 61 63 6b 20 74 6f 20 74 68 65 |ught back to the| 000011c0 20 73 74 61 72 74 2e 20 68 25 20 77 69 6c 6c 20 | start. h% will | 000011d0 74 61 6b 65 20 74 68 65 0d 70 72 69 6e 74 69 6e |take the.printin| 000011e0 67 20 64 6f 77 6e 20 74 6f 20 74 68 65 20 6e 65 |g down to the ne| 000011f0 78 74 20 73 74 61 66 66 2e 0d 0d 49 20 64 65 66 |xt staff...I def| 00001200 69 6e 65 64 20 61 6e 6f 74 68 65 72 20 76 61 72 |ined another var| 00001210 69 61 62 6c 65 20 74 6f 20 74 61 6b 65 20 63 61 |iable to take ca| 00001220 72 65 20 6f 66 20 68 25 20 61 6e 64 20 76 25 2e |re of h% and v%.| 00001230 20 53 75 72 70 72 69 73 69 6e 67 6c 79 20 69 74 | Surprisingly it| 00001240 27 73 0d 63 61 6c 6c 65 64 20 62 25 2e 0d 0d 49 |'s.called b%...I| 00001250 6e 69 74 69 61 6c 6c 79 20 62 25 20 77 61 73 20 |nitially b% was | 00001260 67 69 76 65 6e 20 74 68 65 20 76 61 6c 75 65 20 |given the value | 00001270 30 20 66 72 6f 6d 20 6f 75 74 73 69 64 65 20 74 |0 from outside t| 00001280 68 65 20 52 45 50 45 41 54 20 55 4e 54 49 4c 20 |he REPEAT UNTIL | 00001290 6c 6f 6f 70 2e 20 49 74 0d 77 69 6c 6c 20 6b 65 |loop. It.will ke| 000012a0 65 70 20 74 68 69 73 20 76 61 6c 75 65 20 75 6e |ep this value un| 000012b0 74 69 6c 20 74 68 65 20 65 6e 64 20 6f 66 20 74 |til the end of t| 000012c0 68 65 20 6c 6f 6f 70 20 61 20 6c 69 6e 65 3a 0d |he loop a line:.| 000012d0 0d 62 25 3d 62 25 2b 32 0d 0d 77 69 6c 6c 20 61 |.b%=b%+2..will a| 000012e0 64 64 20 32 20 74 6f 20 69 74 2e 20 49 74 20 77 |dd 2 to it. It w| 000012f0 6f 6e 27 74 20 67 65 74 20 74 6f 20 74 68 65 20 |on't get to the | 00001300 65 6e 64 20 6f 66 20 74 68 65 20 6c 6f 6f 70 20 |end of the loop | 00001310 75 6e 74 69 6c 20 61 20 6b 65 79 20 68 61 73 20 |until a key has | 00001320 62 65 65 6e 0d 70 72 65 73 73 65 64 2e 20 53 6f |been.pressed. So| 00001330 20 66 6f 72 20 74 68 65 20 66 69 72 73 74 20 6b | for the first k| 00001340 65 79 20 70 72 65 73 73 20 62 25 20 77 69 6c 6c |ey press b% will| 00001350 20 3d 20 30 2c 20 66 6f 72 20 74 68 65 20 73 65 | = 0, for the se| 00001360 63 6f 6e 64 20 62 25 20 77 69 6c 6c 20 3d 0d 32 |cond b% will =.2| 00001370 20 61 6e 64 20 73 6f 20 6f 6e 2e 0d 0d 42 61 63 | and so on...Bac| 00001380 6b 20 61 74 20 74 68 65 20 73 74 61 72 74 20 6f |k at the start o| 00001390 66 20 74 68 65 20 6c 6f 6f 70 20 77 65 72 65 20 |f the loop were | 000013a0 33 20 6c 69 6e 65 73 3a 0d 0d 49 46 20 62 25 3c |3 lines:..IF b%<| 000013b0 33 38 76 25 3d 61 25 3a 45 4c 53 45 20 76 25 3d |38v%=a%:ELSE v%=| 000013c0 61 25 2b 38 0d 49 46 20 62 25 3e 37 35 76 25 3d |a%+8.IF b%>75v%=| 000013d0 61 25 2b 31 36 0d 49 46 20 62 25 3e 31 31 32 45 |a%+16.IF b%>112E| 000013e0 4e 44 0d 0d 62 25 20 77 69 6c 6c 20 62 65 20 6c |ND..b% will be l| 000013f0 65 73 73 20 74 68 61 6e 20 33 38 20 77 68 69 6c |ess than 38 whil| 00001400 65 20 70 72 69 6e 74 69 6e 67 20 6f 6e 20 74 68 |e printing on th| 00001410 65 20 66 69 72 73 74 20 73 74 61 66 66 2e 20 53 |e first staff. S| 00001420 6f 20 68 65 72 65 20 76 25 20 77 69 6c 6c 0d 62 |o here v% will.b| 00001430 65 20 65 71 75 61 6c 20 74 6f 20 61 25 2e 20 53 |e equal to a%. S| 00001440 6f 20 69 6e 20 74 68 65 20 65 78 61 6d 70 6c 65 |o in the example| 00001450 20 6c 69 6e 65 20 70 72 69 6e 74 65 64 20 61 62 | line printed ab| 00001460 6f 76 65 20 74 68 65 20 73 65 63 6f 6e 64 20 74 |ove the second t| 00001470 77 6f 20 76 25 0d 76 61 72 69 61 62 6c 65 73 20 |wo v%.variables | 00001480 20 28 68 25 2c 76 25 2c 28 76 25 2b 31 29 29 20 | (h%,v%,(v%+1)) | 00001490 77 69 6c 6c 20 65 71 75 61 6c 20 31 20 61 6e 64 |will equal 1 and| 000014a0 20 32 2e 20 0d 0d 49 66 20 62 25 20 77 61 73 20 | 2. ..If b% was | 000014b0 6d 6f 72 65 20 74 68 61 6e 20 33 38 20 76 25 20 |more than 38 v% | 000014c0 77 6f 75 6c 64 20 62 65 20 65 71 75 61 6c 20 74 |would be equal t| 000014d0 6f 20 61 25 20 70 6c 75 73 20 38 2c 20 73 6f 20 |o a% plus 8, so | 000014e0 69 6e 20 6f 75 72 20 65 78 61 6d 70 6c 65 0d 61 |in our example.a| 000014f0 25 3d 31 2c 20 61 25 2b 38 3d 39 2e 20 76 25 3d |%=1, a%+8=9. v%=| 00001500 39 20 76 25 2b 31 3d 31 30 2e 20 54 68 69 73 20 |9 v%+1=10. This | 00001510 69 73 20 74 6f 20 70 72 69 6e 74 20 6f 6e 74 6f |is to print onto| 00001520 20 74 68 65 20 73 65 63 6f 6e 64 20 73 74 61 66 | the second staf| 00001530 66 2e 20 0d 0d 49 66 20 62 25 20 77 61 73 20 6d |f. ..If b% was m| 00001540 6f 72 65 20 74 68 61 6e 20 37 35 20 76 25 20 77 |ore than 75 v% w| 00001550 6f 75 6c 64 20 62 65 20 65 71 75 61 6c 20 74 6f |ould be equal to| 00001560 20 61 25 2b 31 36 0d 0d 4e 6f 77 20 74 68 65 72 | a%+16..Now ther| 00001570 65 20 69 73 20 61 6e 20 69 6d 70 6f 72 74 61 6e |e is an importan| 00001580 74 20 70 6f 69 6e 74 20 68 65 72 65 2e 20 50 72 |t point here. Pr| 00001590 65 73 73 69 6e 67 20 74 68 65 20 66 69 72 73 74 |essing the first| 000015a0 20 6b 65 79 2c 20 61 25 3d 31 20 73 6f 20 74 68 | key, a%=1 so th| 000015b0 65 0d 76 65 72 74 69 63 61 6c 20 70 72 69 6e 74 |e.vertical print| 000015c0 69 6e 67 20 70 6f 73 69 74 69 6f 6e 73 20 77 69 |ing positions wi| 000015d0 6c 6c 20 62 65 20 31 20 66 6f 72 20 74 68 65 20 |ll be 1 for the | 000015e0 74 6f 70 20 68 61 6c 66 20 61 6e 64 20 32 20 66 |top half and 2 f| 000015f0 6f 72 20 74 68 65 0d 62 6f 74 74 6f 6d 2e 0d 0d |or the.bottom...| 00001600 50 72 65 73 73 69 6e 67 20 74 68 65 20 73 65 63 |Pressing the sec| 00001610 6f 6e 64 20 6b 65 79 20 61 25 3d 32 20 73 6f 20 |ond key a%=2 so | 00001620 74 68 65 20 76 65 72 74 69 63 61 6c 20 70 72 69 |the vertical pri| 00001630 6e 74 69 6e 67 20 70 6f 73 69 74 69 6f 6e 73 20 |nting positions | 00001640 77 69 6c 6c 20 62 65 20 32 0d 66 6f 72 20 74 68 |will be 2.for th| 00001650 65 20 74 6f 70 20 68 61 6c 66 20 61 6e 66 20 33 |e top half anf 3| 00001660 20 66 6f 72 20 74 68 65 20 62 6f 74 74 6f 6d 2e | for the bottom.| 00001670 0d 0d |..| 00001672