220 REM PGM. NAME=XNEXTDH (Double height version of XNEXT on Disk no.12) 225 MODE7 230 REMerror=0:ON ERROR error=ERR:PROCerror 240 PROCinitialise 250 PROCtitle 255 PROCaskcolour 260 PROCaskname 270 REPEAT 280 PROCmenu 290 PROCreaddata 300 PROCreadwords 310 PROCprintscreen 320 REPEAT 330 PROCshuffle 340 REPEAT 350 REPEAT 360 PROCseekanswer 370 UNTIL correct 380 PROCcorrect 390 PROCprintlines 400 UNTIL xdone OR alldone 410 UNTIL alldone 415 t=TIME:REPEAT UNTIL TIME>t+500 420 PROCaskifanother 430 UNTIL notwantanother 440 VDU23,1,1;0;0;0; 450 *FX12,0 460 *FX4,0 470 CLS:END:REM CHAIN"MENU" 480 REM_____________________________________________________________________ 490 DEFPROCinitialise:REM INITIALISE 500 VDU23,1,0;0;0;0; 510 *FX11,0 520 *FX4,1 525 *FX202,32 530 seed=RND(-VAL(RIGHT$(STR$(TIME),4))) 535 w$=CHR$135:g$=CHR$130:m$=CHR$133:d$=CHR$141 540 DIM word$(500),piece$(15),line$(6),tally$(5),Word$(5),WOrd$(5) 550 correct=FALSE 560 ENDPROC 570 REM_____________________________________________________________________ 580 DEFPROCtitle:REM TITLE 590 CLS 600 PRINT TAB(0,1)d$;"This is a large print version of the";TAB(0,2)d$;"This is a large print version of the"; 615 PRINT TAB(0,3)d$;"cryptically named program XNEXT on";TAB(0,4)d$;"cryptically named program XNEXT on"; 620 PRINT TAB(0,5)d$;"Peter Davy's disk number 12.";TAB(0,6)d$;"Peter Davy's disk number 12."; 625 PRINT TAB(0,9)d$;"You are given the words of a passage";TAB(0,10)d$;"You are given the words of a passage"; 630 PRINT TAB(0,11)d$;"3, 4 or 5 at a time in a random order.";TAB(0,12)d$;"3, 4 or 5 at a time in a random order."; 635 PRINT TAB(0,15)d$;"You have to sort the words and build";TAB(0,16)d$;"You have to sort the words and build"; 640 PRINT TAB(0,17)d$;"up the passage.";TAB(0,18)d$;"up the passage."; 645 PRINT TAB(0,21)d$;"Press the SPACE-BAR to carry on.";TAB(0,22)d$;"Press the SPACE-BAR to carry on."; 750 *FX15,0 760 REPEAT:G=GET:IF G<>32 THEN VDU7 770 UNTIL G=32 772 CLS 774 PRINT TAB(0,7)d$;"Requested by Stephen Snowdon and his";TAB(0,8)d$;"Requested by Stephen Snowdon and his";TAB(0,9)d$;"Dad of Crossgates, Leeds.";TAB(0,10)d$;"Dad of Crossgates, Leeds."; 776 PRINT TAB(0,21)d$;"Press the SPACE-BAR to carry on.";TAB(0,22)d$;"Press the SPACE-BAR to carry on."; 778 REPEAT UNTIL GET=32 780 ENDPROC 790 REM_____________________________________________________________________ 800 DEFPROCaskname:REM ASK NAME 810 CLS 820 PRINT TAB(0,2)d$;g$;"Type in your first name and";TAB(0,3)d$;g$;"Type in your first name and";TAB(0,4)d$;g$;"press RETURN please.";TAB(0,5)d$;g$;"press RETURN please."; 825 name$="" 827 REPEAT 830 REPEAT:G$=GET$:UNTIL INSTR("QWERTYUIOPASDFGHJKLZXCVBNM"+CHR$13+CHR$127,G$)<>0 835 IF LEN(name$)<10 AND INSTR("QWERTYUIOPASDFGHJKLZXCVBNM",G$)<>0 THEN name$=name$+G$:PRINT TAB(1,7)d$;name$;TAB(1,8)d$;name$; 840 IF ASC(G$)=127 AND LEN(name$)>0 THEN name$=LEFT$(name$,LEN(name$)-1):PRINT TAB(1,7)d$;name$+" ";TAB(1,8)d$;name$+" "; 845 UNTIL ASC(G$)=13 AND name$<>"" 850 ENDPROC 860 REM_____________________________________________________________________ 870 DEFPROCmenu:REM MENU 880 CLS 890 PRINT TAB(0,1)d$;g$;"Choose which passage to read:";TAB(0,2)d$;g$;"Choose which passage to read:"; 900 PRINT TAB(3,4)d$;g$;"1";w$;"Werty's Favourite Joke.";TAB(3,5)d$;g$;"1";w$;"Werty's Favourite Joke."; 910 PRINT TAB(3,8)d$;g$;"2";w$;"Mending Punctures.";TAB(3,9)d$;g$;"2";w$;"Mending Punctures."; 920 PRINT TAB(3,12)d$;g$;"3";w$;"A Night on the Sleeper.";TAB(3,13)d$;g$;"3";w$;"A Night on the Sleeper."; 930 PRINT TAB(3,16)d$;g$;"Press";w$;"1 2";g$;"or";w$;"3";TAB(3,17)d$;g$;"Press";w$;"1 2";g$;"or";w$;"3"; 940 REPEAT:G$=GET$:UNTIL G$="1" OR G$="2" OR G$="3" 950 IF G$="1" THEN RESTORE 2260 960 IF G$="2" THEN RESTORE 2310 970 IF G$="3" THEN RESTORE 2430 980 CLS:PRINT TAB(0,1)d$;g$;"How many words would you like";TAB(0,2)d$;g$;"How many words would you like";TAB(0,3)d$;g$;"at a time?";TAB(0,4)d$;g$;"at a time?"; 985 PRINT TAB(0,7)d$;g$;"Press";w$;"3 4";g$;"or";w$;"5";TAB(0,8)d$;g$;"Press";w$;"3 4";g$;"or";w$;"5"; 990 REPEAT:G$=GET$:UNTIL G$="3" OR G$="4" OR G$="5" 1000 X=VAL(G$) 1010 ENDPROC 1020 REM____________________________________________________________________ 1030 DEFPROCreaddata:REM READ DATA 1040 CLS:PRINT TAB(0,1)d$;g$;"Don't go away.";TAB(0,2)d$;g$;"Don't go away.";TAB(0,3)d$;g$;"I'll be as quick as I can!";TAB(0,4)d$;g$;"I'll be as quick as I can!"; 1050 N=0 1060 REPEAT 1070 N=N+1 1080 READ piece$(N) 1090 UNTIL RIGHT$(piece$(N),1)="*" 1100 ENDPROC 1110 REM____________________________________________________________________ 1120 DEFPROCreadwords:REM READ WORDS 1130 p%=0:w%=0 1140 REPEAT 1150 p%=p%+1:c%=0 1160 REPEAT 1170 w%=w%+1 1180 REPEAT 1190 c%=c%+1 1200 Q$=MID$(piece$(p%),c%,1) 1210 IF Q$<>" " AND Q$<>"" AND Q$<>"*" THEN word$(w%)=word$(w%)+Q$ 1220 UNTIL Q$=" " OR Q$="" OR Q$="*" 1230 IF RIGHT$(word$(w%),1)="#" THEN word$(w%)=LEFT$(word$(w%),LEN(word$(w%))-1)+w$ 1240 UNTIL Q$="" OR Q$="*" 1250 UNTIL Q$="*" 1260 W=w%:w=1-X:FOR I=1 TO 6:line$(I)="":NEXT I:done=0:wrong=0 1270 ENDPROC 1280 REM____________________________________________________________________ 1290 DEFPROCprintscreen:REM PRINT SCREEN 1293 CLS 1295 FOR I=1 TO 24:PRINT TAB(0,I)d$;:NEXT I 1300 FOR I=15 TO 24:PRINT TAB(1,I)m$;" ";w$;SPC(13);g$;:NEXT I 1305 PRINT TAB(19,15)"Use the up and down";TAB(19,16)"Use the up and down";TAB(19,17)"arrow keys to choose";TAB(19,18)"arrow keys to choose";TAB(19,19)"the first word and";TAB(19,20)"the first word and" 1310 PRINT TAB(19,21)"then press the";TAB(19,22)"then press the";TAB(19,23)"SPACE-BAR.";TAB(19,24)"SPACE-BAR."; 1315 PRINT TAB(2,15)CHR$93;TAB(2,16)CHR$93;:a=15 1320 ENDPROC 1360 REM____________________________________________________________________ 1370 DEFPROCshuffle:REM SHUFFLE 1380 w=w+X 1390 FOR I=1 TO X 1400 Word$(I)=word$(w+I-1) 1410 NEXT I 1420 FOR I=1 TO X 1430 REPEAT 1440 R=RND(X) 1450 UNTIL tally$(R)<>"*" 1460 tally$(R)="*" 1470 WOrd$(I)=Word$(R) 1480 NEXT I 1490 FOR I=1 TO X 1500 PRINT TAB(4,15+(I-1)*2)SPC(13);TAB(4,15+(I-1)*2+1)SPC(13);TAB(4,15+(I-1)*2)WOrd$(I);TAB(4,15+(I-1)*2+1)WOrd$(I); 1510 NEXT I 1520 FOR I=1 TO X:tally$(I)="":NEXT I 1530 n=0 1540 ENDPROC 1550 REM____________________________________________________________________ 1560 DEFPROCseekanswer:REM SEEK ANSWER 1570 n=n+1 1580 IF n=2 THEN PRINT TAB(19,19)"the next word and ";TAB(19,20)"the next word and "; 1590 IF n=X THEN xdone=TRUE ELSE xdone=FALSE 1600 REPEAT 1610 REPEAT 1620 G=GET 1630 UNTIL G=139 OR G=138 OR G=32 1640 REM:PRINT TAB(0,0) ?2+256*?3-TOP 1650 IF G=139 THEN PROCmovearrowup 1660 IF G=138 THEN PROCmovearrowdown 1670 IF G=32 AND WOrd$((a-13)/2)=Word$(n) THEN correct=TRUE 1680 IF G=32 AND WOrd$((a-13)/2)<>Word$(n) THEN correct=FALSE:IF WOrd$((a-13)/2)<>"" THEN VDU7:wrong=wrong+1 1690 UNTIL correct 1700 IF RIGHT$(Word$(n),1)=w$ THEN newpara=TRUE:Word$(n)=LEFT$(Word$(n),LEN(Word$(n))-1) ELSE newpara=FALSE 1710 ENDPROC 1720 REM____________________________________________________________________ 1730 DEFPROCmovearrowup:REM MOVE ARROW UP 1740 IF a>15 THEN PRINT TAB(2,a)" ";TAB(2,a+1)" ";:a=a-2:PRINT TAB(2,a)CHR$93;TAB(2,a+1)CHR$93; 1750 ENDPROC 1760 REM____________________________________________________________________ 1770 DEFPROCmovearrowdown:REM MOVE ARROW DOWN 1780 IF a<15+(X-1)*2 THEN PRINT TAB(2,a)" ";TAB(2,a+1)" ";:a=a+2:PRINT TAB(2,a)CHR$93;TAB(2,a+1)CHR$93; 1790 ENDPROC 1800 REM____________________________________________________________________ 1810 DEFPROCcorrect:REM CORRECT 1820 PRINT TAB(4,a)SPC(13);TAB(4,a+1)SPC(13); 1830 correct=FALSE:done=done+1:IF done=W THEN alldone=TRUE ELSE alldone=FALSE 1840 IF newpara THEN PROCmoveup:PROCmoveup:newpara=FALSE 1850 IF LEN(line$(6))=0 THEN line$(6)=Word$(n):WOrd$((a-13)/2)="":ENDPROC 1860 IF LEN(line$(6))+1+LEN(Word$(n))<=39 THEN line$(6)=line$(6)+" "+Word$(n):WOrd$((a-13)/2)="":ENDPROC 1870 IF LEN(line$(6))+1+LEN(Word$(n))>39 THEN PROCmoveup:line$(6)=Word$(n):WOrd$((a-13)/2)="":ENDPROC 1880 ENDPROC 1890 REM____________________________________________________________________ 1900 DEFPROCmoveup:REM MOVE UP 1910 FOR I=1 TO 5 1920 line$(I)=line$(I+1) 1930 NEXT I 1940 line$(6)="" 1950 ENDPROC 1960 REM____________________________________________________________________ 1970 DEFPROCprintlines:REM PRINT LINES 1980 FOR I=1 TO 6 1990 PRINT TAB(1,1+(I-1)*2)SPC(39);TAB(1,2+(I-1)*2)SPC(39);TAB(1,1+(I-1)*2)line$(I);TAB(1,2+(I-1)*2)line$(I); 2000 NEXT I 2010 ENDPROC 2020 REM____________________________________________________________________ 2030 DEFPROCaskifanother:REM ASK IF ANOTHER 2040 CLS 2050 PRINT TAB(0,1)d$;g$;"Very good ";name$;"!";TAB(0,2)d$;g$;"Very good ";name$;"!";TAB(0,3)d$;g$;"You have finished that passage.";TAB(0,4)d$;g$;"You have finished that passage.";TAB(0,7)d$;g$;"You made";TAB(0,8)d$;g$;"You made"; 2060 IF wrong=0 THEN PRINT TAB(11,7)"no mistakes at all while";TAB(11,8)"no mistakes at all while"; 2070 IF wrong=1 THEN PRINT TAB(11,7)"one mistake while";TAB(11,8)"one mistake while"; 2080 IF wrong>1 THEN PRINT TAB(11,7);wrong;" mistakes while";TAB(11,8);wrong;" mistakes while"; 2090 PRINT TAB(0,9)d$;g$;"choosing ";W;" words.";TAB(0,10)d$;g$;"choosing ";W;" words."; 2100 PRINT TAB(0,13)d$;g$;"Press";w$;"A";g$;"for another or";w$;"F";g$;"to finish.";TAB(0,14)d$;g$;"Press";w$;"A";g$;"for another or";w$;"F";g$;"to finish."; 2110 REPEAT:G$=GET$ 2120 UNTIL G$="A" OR G$="F" 2130 IF G$="F" THEN notwantanother=TRUE ELSE notwantanother=FALSE 2140 IF G$="A" THEN FOR I=1 TO W:word$(I)="":NEXT I 2150 ENDPROC 2160 REM____________________________________________________________________ 2170 DEFPROCerror:REM ERROR 2180 IF error=17 THEN CHAIN"MENU" 2190 IF error<>0 THEN REPORT:PRINT" at line no. ";ERL 2200 PRINT''"Press RETURN to return to the menu" 2210 REPEAT:G=GET:IF G<>13 THEN VDU7 2220 UNTIL G=13 2230 CHAIN"MENU" 2240 ENDPROC:REM This will not be executed as execution will always jump out of the procedure. This does not matter as another program (MENU) is being called. 2250 REM____________________________________________________________________ 2260 DATA Last week Bill and Tom spent an evening at the pub. They decided to have a bit of fun with the bar-man. Tom told the bar-man that his friend Bill was a bit eccentric and would like to pay for their drinks with milk tops. The 2270 DATA bar-man agreed to accept the milk tops on the understanding that Tom would settle up at the end of the evening with real money. Everything# worked out perfectly. They had a very pleasant evening and each time they had new 2280 DATA drinks Bill paid for them with milk tops which the bar-man accepted without batting an eyelid. As# closing time approached the bar-man had a quiet word with Tom. He said that the sum owing was seven pounds eighty two pence. 2290 DATA Tom said this sounded very reasonable but you should have seen the bar-man's face when Tom asked him if he had change for a dust-bin lid!* 2300 2310 DATA"Although a bicycle is a very reliable means of transport, it is always likely to let you down by getting a puncture in one of its tyres. You# can get what is known as a slow puncture. The air leaks out of the tyre slowly." 2320 DATA You can pump up the tyre and ride for some distance before the tyre becomes too soft and needs pumping up again. Some people put off mending a slow puncture for months. You can tell a cyclist with a slow puncture by the 2330 DATA anxious look on his face. Most# punctures are fast ones. You can't pump up the tyre at all. The puncture must be mended before you can ride. Riding on a flat tyre will ruin it. The# first thing to do is turn the bicycle 2340 DATA upside down. Then you have to decide whether to take out the wheel. If the puncture is in the front tyre I usually take the wheel out as it is quite easy to put it back afterwards. With the back wheel you have trouble with 2350 DATA the chain and the gears and I usually mend the puncture without removing the wheel. Tyre# levers are used to remove the tyre. You have to be careful not to trap the inner tube with the tyre levers or you may have more 2360 DATA punctures to mend than you thought! Finding the puncture isn't always easy. Sometimes you pump up the inner tube and it stays plump and doesn't seem to be losing air at all. It helps to put the inner tube in a bowl of 2370 DATA water and look for a stream of tiny bubbles. Sometimes the puncture is so big that the inner tube won't pump up at all. Having# found the puncture it is most important to make the area around it dry and clean. A piece of 2380 DATA fine glass-paper is useful for cleaning. Next the area around the puncture is coated with a layer of rubber solution. It is essential to leave the rubber solution for a minute or two to become tacky before removing the 2390 DATA protective film from the patch and pressing it firmly over the puncture. There# are two things to do before putting the inner tube back in the tyre. Firstly put plenty of talcum powder on the repair or next time you have 2400 DATA a puncture you'll find the inner tube stuck to the inside of the tyre! Secondly feel carefully round the inside of the tyre to find and remove the object which caused the puncture. Finally# the inner tube is put back in the 2410 DATA tyre and the tyre is put back on the rim of the wheel. Tyre levers must not be used. Find out how to put the tyre on with your hands from someone who can do it. Happy# pedalling!* 2420 2430 DATA A few years ago I needed to be in Plymouth one evening and in London the next morning. It was an ideal opportunity to find out what it is like to spend a night on a British Rail sleeping coach. The# train left Plymouth 2440 DATA at about midnight. I was sharing a compartment with a fussy little man who was travelling on to Harwich to catch a boat. I agreed that when we reached London he could get up first and use the washing facilities as he 2450 DATA would not have much time to spare to catch his next train. I slept on the top bunk and he slept on the bottom one. I# have always prided myself on being able to sleep anywhere and no doubt I did sleep for much of the 2460 DATA journey but I didn't feel as if I slept at all. I woke up each time the train clanked to a stop which it seemed to do twenty to thirty times. I# was not sorry when the train made its final stop at Paddington Station. 2470 DATA"As arranged, my friend from the bottom bunk got up first and was soon on his way. Being in need of the toilet and bearing in mind the rule about not using the toilet on a train standing in a station, I slipped my dressing" 2480 DATA gown over my pyjamas and went on to the station. I had to turn several corners before I found the toilets. My# memory is not very good at the best of times but it is particularly bad first thing in a morning and especially 2490 DATA a morning following a night of continuous train noise. After five minutes tramping up and down the platforms it dawned on me that I couldn't find the train! It was like one of those dreams where you are in a public place 2500 DATA dressed in nothing but a short shirt! I became convinced that the train had departed in my absence. People were probably looking at me but I wasn't too sure as I didn't have my glasses on. Then# to my relief I found the 2510 DATA train. It had been there all the time. I washed and dressed quickly and went off in search of breakfast.* 2599 REM____________________________________________________________________ 2600 DEFPROCaskcolour 2610 CLS:PRINT TAB(1,1)d$;"Press W if you would like print";TAB(1,2)d$;"Press W if you would like print";TAB(1,3)d$;"to be white.";TAB(1,4)d$;"to be white."; 2620 PRINT TAB(1,7)d$;"Press C if you would like some of";TAB(1,8)d$;"Press C if you would like some of";TAB(1,9)d$;"the print to be coloured.";TAB(1,10)d$;"the print to be coloured."; 2630 REPEAT:G$=GET$:UNTIL INSTR("WC",G$)<>0 2640 IF G$="W" THEN g$=CHR$135:m$=CHR$135 2650 ENDPROC