10 : 20 : 30 : 40 REM"„‡THIS PROGRAM BY NEIL TAYLOR „ ‡WAS IN ISSUE 39 OF 8-BIT SOFTWARE 50 : 60 REM"„‡CHANGED TO BBC BASIC IN „ „‡ISSUE 40 8BS BY D PRITCHARD JONES 3PM 70 REM"„‡'TARTEDUP' WITH MAP, COLOUR „‡AND REF.NOs.ETC. BY ROY DICKENS 20G 80 ON ERROR PROCerr:END 90 MODE7 100 VDU23,1,0;0;0;0; 110 PROCfirstpage 120 PROCpressSpace 130 PROCmes2 140 PROCpressSpace 150 PROCmes1 160 PROCpressSpace 170 CLEAR 180 PROCin 190 PROCrefno 200 VDU23,1,1;0;0;0; 210 PROCfirstno 220 PROCsecondno 230 CLS 240 PROCtheworks 250 PROCmap 260 PROCletters 270 PROCprintmiles 280 PROCagain 290 END 300 DEFPROCin 310 DIM P$(16) 320 CLS 330 number$="0123456789" 340 letter1$="NTS" 350 letter2$="ABCDEFGHIJKLMNOPQURSTUVWXYZ" 360 A$="SVSQ NQNLNFNAHVHQHLSWSRSMSGSBNWNRNMNGNBHWHRHMSXSSSNSHSCNXNSNNNHNCHXHSHNSYSTSOSJSDNYNTNONJNDHYHTHOSZSUSPSKSENZNUNPNKNEHZHUHPTVTQTLTFTAOVOQOLOFOAJVJQJL TRTMTG" 370 ENDPROC 380 REM"ƒ..NEIL TAYLOR K3T STARTED IT ƒ ALL WITH THIS NEXT BIT. THANKS NEIL.. ƒAND... 390 REM"ƒ..DERRICK PRITCHARD JONES 3PM ƒCHANGED THIS BIT TO BBC BASIC. ƒTHANKS DERRICK 400 DEF PROCtheworks 410 B$=inpL1$+inpL2$+inpN1$+inpL3$+inpL4$+inpN2$ 420 C$=LEFT$(B$,2) 430 PROCnc 440 M=N:D=C:C$=MID$(B$,9,2) 450 PROCnc 460 V=ABS((M-N)*500+VAL MID$(B$,6,3)-VAL RIGHT$(B$,3)) 470 H=ABS((C-D)*1000+VAL MID$(B$,11,3)-VAL MID$(B$,3,3)) 480 X=SQR(V^2+H^2)*.06214 490 @%=&2020A 500 PRINT 510 REM PRINT; X;" Miles from ";inpL1$+inpL2$+inpN1$;" to ";inpL3$+inpL4$+inpN2$ 520 REM PRINT "Range is ";1.1123*X;" to ";1.3186*X;" miles" 530 REMPRINT "Average estimate = ";1.2405*X;" miles" 540 ENDPROC 550 REM"ƒ..AND THIS BIT.. 560 DEF PROCnc 570 N=INSTR(A$,C$):IF N=0 PRINT"INVALID MAP REFERENCE. TRY AGAIN":T=TIME:REPEAT UNTIL TIME>T+200:GOTO150 580 C=N DIV 26+1 590 N=N MOD 26 600 ENDPROC 610 REM"ƒ.............................. 620 DEF PROCrefno 630 PROCdh(1,1,1,"A few National Grid ref. numbers") 640 PROCdh(1,3,0,"E&OE.") 650 PRINT' 660 FOR loops%=1TO16 670 READ P$(loops%) 680 PRINTCHR$(134)P$(loops%) 690 NEXT loops% 700 PROCdh(3,23,0,"Please press space to continueˆ>>>‰") 710 PROCpressSpace 720 ENDPROC 730 DEF PROCfirstno 740 CLS 750 PROCdh(1,1,1,"To find the distance from 'A' to 'B'") 760 PROCdh(1,3,0,"two grid ref. numbers (obtained from") 770 PROCdh(1,4,0," your map) are required.") 780 PROCdh(2,5,0,"FIRST GRID REFERENCE") 790 PROCdh(2,6,0,"(example SP822381)") 800 PRINTTAB(0,7)CHR$(131)"Note:-" 810 PRINTTAB(0,8)CHR$(131)"First letter will be N, T or S." 820 PRINTTAB(0,10);CHR$(134);"Type the first (one) letter "; 830 inpL1$=FN_gpi(1,1,letter1$) 840 IF LEN(inpL1$)<1 GOTO820 850 PRINTTAB(0,10);CHR$(134);"and now the second letter ";inpL1$;" "; 860 inpL2$=FN_gpi(1,1,letter2$) 870 IF LEN(inpL2$)<1 GOTO850 880 PRINTTAB(0,10);CHR$(134);"and the six figures "inpL1$+inpL2$;" "; 890 inpN1$=FN_gpi(6,0,number$) 900 IF LEN(inpN1$)<6 GOTO880 910 PRINTTAB(0,12);CHR$(131);" Is this correct Y/N? "; 920 IF FNyesno="Y"THEN PRINT TAB(24,12)"Yes"ELSE PRINT TAB(24,12)"No ":PRINTTAB(0,12);STRING$(30," "):PROCfirstno 930 ENDPROC 940 DEF PROCsecondno 950 PRINTTAB(0,14)CHR$(147);STRING$(35,CHR$(172)) 960 PRINTTAB(0,20);STRING$(36," ") 970 PROCdh(2,16,0,"SECOND GRID REFERENCE") 980 PROCdh(2,17,0,"(example SO700435) ") 990 PRINTTAB(0,18);CHR$(131);"Note:-" 1000 PRINTTAB(0,19);CHR$(131);"First letter will be N, T or S." 1010 PRINTTAB(0,21)CHR$(134);"Type the first (one) letter "; 1020 inpL3$=FN_gpi(1,1,letter1$) 1030 IF LEN(inpL3$)<1 GOTO1010 1040 PRINTTAB(0,21);CHR$(134);"and now the second letter ";inpL3$;" "; 1050 inpL4$=FN_gpi(1,1,letter2$) 1060 IF LEN(inpL4$)<1 GOTO 1040 1070 PRINTTAB(0,21);CHR$(134);"and the six figures "inpL3$+inpL4$;" "; 1080 inpN2$=FN_gpi(6,0,number$) 1090 IF LEN(inpN2$)<6 GOTO1070 1100 PRINTTAB(1,23);CHR$(131);"Is this correct Y/N? "; 1110 IF FNyesno="Y"THEN PRINT TAB(24,23)"Yes"ELSE PRINT TAB(24,23)"No ":PRINTTAB(0,23);STRING$(30," "):PROCsecondno 1120 ENDPROC 1130 DEFFN_gpi(len,effect,valid$) 1140 LOCALa$,b 1150 a$="" 1160 PRINTSTRING$(len,".");STRING$(len+1,CHR$(8));" ";:*FX15,1 1170 b=GET:IF b=13 THEN =a$ 1180 IF b=127 AND a$=""THEN 1170 1190 IF b=127 a$=LEFT$(a$,LEN(a$)-1):PRINTCHR$b;".";CHR$(8);:GOTO 1170 1200 IF effect=0 THEN 1230 1210 IF effect=1 b=b AND 223 ELSE b=bOR32 1220 IF effect=3 AND (RIGHT$(a$,1)=" " OR a$="") b=b AND 223 1230 IF LEN(a$)=len OR INSTR(valid$,CHR$b)=0 VDU7:GOTO1170 1240 PRINTCHR$b;:a$=a$+CHR$b:GOTO1170 1250 DEF FNyesno 1260 LOCAL key$ 1270 REPEAT 1280 key$=CHR$(GET AND &DF) 1290 UNTIL INSTR("YN",key$) 1300 =key$ 1310 DEF PROCmap 1320 PRINTCHR$146"šš¼  ąōōüü“ " 1330 PRINTCHR$146"šÆ ź¤ų’’’÷   " 1340 PRINTCHR$146"šš  ų’’’’÷žż’% " 1350 PRINTCHR$146"šė“ź’’’’’’’’7 " 1360 PRINTCHR$146"š Øæ«’’’’’’?”  " 1370 PRINTCHR$146"š ą ś’’’’’’÷  " 1380 PRINTCHR$146"š £ų§’’’’’÷ć  " 1390 PRINTCHR$146"š  „¢ąž’’’’’ż  " 1400 PRINTCHR$146"š    ąž’’’’’’“ " 1410 PRINTCHR$146"š    źė/’’’’’’“ " 1420 PRINTCHR$146"š    Ŗ’’’’’’’ü°" 1430 PRINTCHR$146"šMAP *”ź’’’’’’æ/ " 1440 PRINTCHR$146"šNOT ü Ŗ’’’’’’’ü0" 1450 PRINTCHR$146"šTO xüžž’’’’’’’?" 1460 PRINTCHR$146"šSCALE”ź’’’’’’’’’}x’ż" 1470 PRINTCHR$146"š      ś’’’’’’’’’’’’’µ" 1480 PRINTCHR$146"š    üž’’’’’’’’’’’’’· " 1490 PRINTCHR$146"š   ¢ ŖƧū’’’’’’’’óš° " 1500 PRINTCHR$146"š     ųü’’’’’’’’’’’§” " 1510 PRINTCHR$146"š    ś’’’’’ÆÆį³£«Æ” " 1520 PRINTCHR$146"š  Ø«„«Æ££” " 1530 ENDPROC 1540 DEF PROCprintmiles 1550 @%=&2000A 1560 PRINTTAB(20,3)CHR$(131);"Distance between" 1570 PRINTTAB(17,4)CHR$(131);inpL1$+inpL2$+inpN1$;" and ";inpL3$+inpL4$+inpN2$ 1580 PRINTTAB(22,5)CHR$(131);"= ";X;" miles" 1590 REM********************** 1600 REM"CHANGE 1.1123*X AND/OR 1.3186*X SHOWN BELOW IF YOU WISH 1610 1620 PRINTTAB(24,7)CHR$(131);"Range is " 1630 PRINTTAB(20,8)CHR$(131);1.1123*X;" to ";1.3186*X;" miles" 1640 PRINTTAB(20,10)CHR$(131);"Average estimate" 1650 REM*********************** 1660 REM"CHANGE 1.2405*X SHOWN BELOW IF YOU WISH 1670 1680 PRINTTAB(22,11)CHR$(131);"= "1.2405*X;" miles" 1690 ENDPROC 1700 DEF PROCletters 1710 IF inpL1$+inpL2$="SU"ORinpL3$+inpL4$="SU":PROCgrid("S","U",14,18) 1720 IF inpL1$+inpL2$="SS"ORinpL3$+inpL4$="SS":PROCgrid("S","S",8,18) 1730 IF inpL1$+inpL2$="ST"ORinpL3$+inpL4$="ST":PROCgrid("S","T",10,18) 1740 IF inpL1$+inpL2$="TQ"ORinpL3$+inpL4$="TQ":PROCgrid("T","Q",17,18) 1750 IF inpL1$+inpL2$="TR"ORinpL3$+inpL4$="TR":PROCgrid("T","R",20,18) 1760 IF inpL1$+inpL2$="SW"ORinpL3$+inpL4$="SW":PROCgrid("S","W",5,20) 1770 IF inpL1$+inpL2$="SX"ORinpL3$+inpL4$="SX":PROCgrid("S","X",8,20) 1780 IF inpL1$+inpL2$="SY"ORinpL3$+inpL4$="SY":PROCgrid("S","Y",10,20) 1790 IF inpL1$+inpL2$="SZ"ORinpL3$+inpL4$="SZ":PROCgrid("S","Z",14,20) 1800 IF inpL1$+inpL2$="TV"ORinpL3$+inpL4$="TV":PROCgrid("T","V",17,20) 1810 IF inpL1$+inpL2$="SM"ORinpL3$+inpL4$="SM":PROCgrid("S","M",5,16) 1820 IF inpL1$+inpL2$="SN"ORinpL3$+inpL4$="SN":PROCgrid("S","N",8,16) 1830 IF inpL1$+inpL2$="SO"ORinpL3$+inpL4$="SO":PROCgrid("S","O",10,16) 1840 IF inpL1$+inpL2$="SP"ORinpL3$+inpL4$="SP":PROCgrid("S","P",14,16) 1850 IF inpL1$+inpL2$="TL"ORinpL3$+inpL4$="TL":PROCgrid("T","L",17,16) 1860 IF inpL1$+inpL2$="TM"ORinpL3$+inpL4$="TM":PROCgrid("T","M",20,16) 1870 IF inpL1$+inpL2$="SH"ORinpL3$+inpL4$="SH":PROCgrid("S","H",8,14) 1880 IF inpL1$+inpL2$="SJ"ORinpL3$+inpL4$="SJ":PROCgrid("S","J",10,14) 1890 IF inpL1$+inpL2$="SK"ORinpL3$+inpL4$="SK":PROCgrid("S","K",14,14) 1900 IF inpL1$+inpL2$="TF"ORinpL3$+inpL4$="TF":PROCgrid("T","F",17,14) 1910 IF inpL1$+inpL2$="TG"ORinpL3$+inpL4$="TG":PROCgrid("T","G",20,14) 1920 IF inpL1$+inpL2$="SD"ORinpL3$+inpL4$="SD":PROCgrid("S","D",9,11) 1930 IF inpL1$+inpL2$="SE"ORinpL3$+inpL4$="SE":PROCgrid("S","E",12,11) 1940 IF inpL1$+inpL2$="TA"ORinpL3$+inpL4$="TA":PROCgrid("T","A",15,11) 1950 IF inpL1$+inpL2$="NZ"ORinpL3$+inpL4$="NZ":PROCgrid("N","Z",12,9) 1960 IF inpL1$+inpL2$="NY"ORinpL3$+inpL4$="NY":PROCgrid("N","Y",9,9) 1970 IF inpL1$+inpL2$="NX"ORinpL3$+inpL4$="NX":PROCgrid("N","X",6,9) 1980 IF inpL1$+inpL2$="NU"ORinpL3$+inpL4$="NU":PROCgrid("N","U",12,7) 1990 IF inpL1$+inpL2$="NT"ORinpL3$+inpL4$="NT":PROCgrid("N","T",9,7) 2000 IF inpL1$+inpL2$="NS"ORinpL3$+inpL4$="NS":PROCgrid("N","S",6,7) 2010 IF inpL1$+inpL2$="NR"ORinpL3$+inpL4$="NR":PROCgrid("N","R",3,7) 2020 IF inpL1$+inpL2$="NO"ORinpL3$+inpL4$="NO":PROCgrid("N","O",10,5) 2030 IF inpL1$+inpL2$="NN"ORinpL3$+inpL4$="NN":PROCgrid("N","N",7,5) 2040 IF inpL1$+inpL2$="NM"ORinpL3$+inpL4$="NM":PROCgrid("N","M",4,5) 2050 IF inpL1$+inpL2$="NJ"ORinpL3$+inpL4$="NJ":PROCgrid("N","J",11,3) 2060 IF inpL1$+inpL2$="NH"ORinpL3$+inpL4$="NH":PROCgrid("N","H",8,3) 2070 IF inpL1$+inpL2$="NG"ORinpL3$+inpL4$="NG":PROCgrid("N","G",5,3) 2080 IF inpL1$+inpL2$="ND"ORinpL3$+inpL4$="ND":PROCgrid("N","D",11,1) 2090 IF inpL1$+inpL2$="NC"ORinpL3$+inpL4$="NC":PROCgrid("N","C",8,1) 2100 ENDPROC 2110 DEF PROCgrid(R$,D$,a,b) 2120 PRINT TAB(a,b)CHR$(129)R$CHR$(146) 2130 PRINT TAB(a,b+1)CHR$(129)D$CHR$(146) 2140 ENDPROC 2150 DEF PROCagain 2160 PRINTTAB(0,23);CHR$(134);" Would you like another go. Y/N? "; 2170 IF FNyesno="Y"THEN GOTO170 ELSE CLS: PRINT TAB(0,10)"BYE FROM ROY, HAVE A PLEASANT JOURNEY":@%=&90A:END 2180 ENDPROC 2190 DEF PROCerr 2200 IF ERR<> 17 THEN REPORT:PRINT" at line ";ERL:ENDPROC 2210 IF ERR=17 CLS:PROCagain:ENDPROC 2220 DEF PROCmes1 2230 CLS 2240 PROCdh(1,3,1,"Message from Neil Taylor (K3T)") 2250 PROCdh(1,5,0,"(abridged from 8BS issue 39)") 2260 PROCdh(6,7,0,"* Notes about DEF PROCprintmiles *") 2265 PROCdh(6,8,0,"(Lines 1630 and 1680.)") 2270 PROCdh(6,9,0,"The listing contains my own figures") 2280 PROCdh(6,10,0,"for the min. and max. percentage inc-") 2290 PROCdh(6,11,0,"reases (likely range).It also contains") 2300 PROCdh(6,12,0,"the mean average from all my recorded ") 2310 PROCdh(6,13,0,"journeys.I suggest using these figures") 2320 PROCdh(6,14,0,"as a starting point but your own geog-") 2330 PROCdh(6,15,0,"aphical location and choice of roads is") 2340 PROCdh(6,16,0,"bound to yield different results.") 2350 PROCdh(6,17,0,"If the program is used intelligently as") 2360 PROCdh(6,18,0,"a guestimation aid then with a bit of ") 2370 PROCdh(6,19,0,"experience you will be surprised by how") 2380 PROCdh(6,20,0,"much utility it can actually have.") 2390 PROCdh(3,22,0,"Please press space to continueˆ>>>‰") 2400 ENDPROC 2410 DEF PROCmes2 2420 CLS 2430 PROCdh(1,0,1,"The National Grid") 2440 PROCdh(3,2,0,"(Example ref.no. SP822381") 2450 PROCdh(6,3,0,"Most road atlases have the national") 2460 PROCdh(6,4,0,"grid. Great Britain is divided into 100") 2470 PROCdh(6,5,0,"kilometre grid squares, each of which ") 2480 PROCdh(6,6,0,"is identified by a set of 2 letters.") 2490 PROCdh(6,7,0,"These squares are further sub-divided") 2500 PROCdh(6,8,0,"into smaller squares by grid lines") 2510 PROCdh(6,9,0,"spaced 10 kilometres apart, each of ") 2520 PROCdh(6,10,0,"which is numbered from 0 to 9 in a") 2530 PROCdh(6,11,0,"easterly or northerly direction.This") 2540 PROCdh(6,12,0,"will give the first and fourth figure.") 2550 PROCdh(3,13,0,"Example SP 8.. 3..") 2560 PROCdh(6,14,0,"The 10 squares need to be divided into") 2570 PROCdh(6,15,0,"further 10x10 squares to give the ") 2580 PROCdh(6,16,0,"second and fifth figure.") 2590 PROCdh(3,17,0,"Example SP 82. 38.") 2600 PROCdh(6,18,0,"It is easier to guess the third and ") 2610 PROCdh(6,19,0,"sixth figure as you would be using a") 2620 PROCdh(6,20,0," 1:50 000 map for these. Read across") 2630 PROCdh(6,21,0,"the BOTTOM FIRST and THEN UP THE SIDE.") 2640 PROCdh(5,22,0,"(Along the corridor and up the stairs)") 2650 PROCdh(3,23,0,"Please press space to continueˆ>>>‰") 2660 ENDPROC 2670 DEF PROCfirstpage 2680 CLS 2690 PRINT' 2700 PROCdh(1,1,1,"Mileage from OS maps") 2710 PROCdh(1,3,0,"by Roy Dickens") 2720 PROCdh(1,5,0,"Based on a program 'OSMAP' submitted ") 2730 PROCdh(1,6,0,"by Neil Taylor (8-BIT issue 39)") 2740 PROCdh(2,9,1,"Using the Ordnance Survey Nat.Grid") 2750 PROCdh(2,11,1,"this program may help you to measure") 2760 PROCdh(2,13,1,"the mileage between two points.") 2770 PROCdh(6,16,0,"May I thank Mr N Taylor (K3T) for the") 2780 PROCdh(6,17,0,"'core' of this program.") 2790 PROCdh(6,19,0,"Also Mr D Pritchard-Jones for his help") 2800 PROCdh(6,20,0,"by changing the 'core' into BBC Basic.") 2810 PROCdh(3,23,0,"Please press space to continueˆ>>>‰") 2820 ENDPROC 2830 DEF PROCdh(C%,L%,D%,A$) 2840 IF D% A$=CHR$(141)+A$ 2850 X%=(40-LENA$)DIV 2-1 2860 FORY%=L%TOL%+D%:PRINTTAB(X%,Y%);CHR$(128+C%);A$:NEXT 2870 ENDPROC 2880 DEF PROCpressSpace 2890 *FX15,0 2900 REPEAT 2910 UNTIL GET=32 2920 ENDPROC 2930 : 2940 : 2950 DATA Aberdeen NJ930050.Accring/n SD750280 2960 DATA Basingst/k SU630510. Bristol ST580720 2970 DATA Billericay TQ670940. Bolton SD710080 2980 DATA Clacton TM170150.Crawcrook NZ130630 2990 DATA Eaglescli/eNZ420150. Flitwick TL030350 3000 DATA Hedon TA180280. Halifax SE080250 3010 DATA Lincoln SK970710.Liverpool SJ350910 3020 DATA Lytham S/A SD340270. Leeds SE300340 3030 DATA Nelson La. SD870370.Notting/m SK570410 3040 DATA Plymouth SX470550. Penrith NY510300 3050 DATA Rushden SP950660. Romford TQ510880 3060 DATA Selby SE610320.Sheffield SK350870 3070 DATA Skegness TF560630.St.Albans TL150070 3080 DATA Southamp/n SU420120. Swansea SS650930 3090 DATA Stoke on T SJ870450.SunderlandNZ390570 3100 DATA Thetford TL870830. Wickford TQ750930