8-Bit Software Online Conversion

Build A Word Passage - Listing

220 REM PGM. NAME=XNEXTDH (Double heig ht version of XNEXT on Disk no.12) 225 MODE7 230 REMerror=0:ON ERROR error=ERR:PROC error 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 i s a large print version of the"; 615 PRINT TAB(0,3)d$;"cryptically name d program XNEXT on";TAB(0,4)d$;"cryptica lly named program XNEXT on"; 620 PRINT TAB(0,5)d$;"Peter Davy's dis k number 12.";TAB(0,6)d$;"Peter Davy's d isk number 12."; 625 PRINT TAB(0,9)d$;"You are given th e words of a passage";TAB(0,10)d$;"You a re 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 sor t 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 th e 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 Ste phen Snowdon and his";TAB(0,8)d$;"Reques ted 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 th e 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 y our first name and";TAB(0,4)d$;g$;"press RETURN please.";TAB(0,5)d$;g$;"press RE TURN please."; 825 name$="" 827 REPEAT 830 REPEAT:G$=GET$:UNTIL INSTR("QWERTY UIOPASDFGHJKLZXCVBNM"+CHR$13+CHR$127,G$) <>0 835 IF LEN(name$)<10 AND INSTR("QWERTY UIOPASDFGHJKLZXCVBNM",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 TH EN 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$;"Mendin g Punctures.";TAB(3,9)d$;g$;"2";w$;"Mend ing Punctures."; 920 PRINT TAB(3,12)d$;g$;"3";w$;"A Nig ht 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$;"Pres s";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.";TA B(0,3)d$;g$;"I'll be as quick as I can!" ;TAB(0,4)d$;g$;"I'll be as quick as I ca n!"; 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 wo rd$(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$;:NE XT 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 do wn";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 fir st word and";TAB(19,20)"the first word a nd" 1310 PRINT TAB(19,21)"then press the";T AB(19,22)"then press the";TAB(19,23)"SPA CE-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 n ext 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 newp ara=TRUE:Word$(n)=LEFT$(Word$(n),LEN(Wor d$(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;T AB(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)SP C(13); 1830 correct=FALSE:done=done+1:IF done= W THEN alldone=TRUE ELSE alldone=FALSE 1840 IF newpara THEN PROCmoveup:PROCmov eup:newpara=FALSE 1850 IF LEN(line$(6))=0 THEN line$(6)=W ord$(n):WOrd$((a-13)/2)="":ENDPROC 1860 IF LEN(line$(6))+1+LEN(Word$(n))<= 39 THEN line$(6)=line$(6)+" "+Word$(n):W Ord$((a-13)/2)="":ENDPROC 1870 IF LEN(line$(6))+1+LEN(Word$(n))>3 9 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 ";n ame$;"!";TAB(0,2)d$;g$;"Very good ";name $;"!";TAB(0,3)d$;g$;"You have finished t hat passage.";TAB(0,4)d$;g$;"You have fi nished 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 mis takes at all while"; 2070 IF wrong=1 THEN PRINT TAB(11,7)"on e mistake while";TAB(11,8)"one mistake w hile"; 2080 IF wrong>1 THEN PRINT TAB(11,7);wr ong;" 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 fini sh.";TAB(0,14)d$;g$;"Press";w$;"A";g$;"f or 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 execu ted 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 h ave a bit of fun with the bar-man. Tom t old the bar-man that his friend Bill was a bit eccentric and would like to pay f or 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 evenin g with real money. Everything# worked ou t perfectly. They had a very pleasant ev ening and each time they had new 2280 DATA drinks Bill paid for them wit h milk tops which the bar-man accepted w ithout batting an eyelid. As# closing ti me approached the bar-man had a quiet wo rd with Tom. He said that the sum owing was seven pounds eighty two pence. 2290 DATA Tom said this sounded very re asonable but you should have seen the ba r-man's face when Tom asked him if he ha d change for a dust-bin lid!* 2300 2310 DATA"Although a bicycle is a very reliable means of transport, it is alway s likely to let you down by getting a pu ncture in one of its tyres. You# can get what is known as a slow puncture. The a ir leaks out of the tyre slowly." 2320 DATA You can pump up the tyre and ride for some distance before the tyre b ecomes too soft and needs pumping up aga in. Some people put off mending a slow p uncture for months. You can tell a cycli st with a slow puncture by the 2330 DATA anxious look on his face. Mos t# punctures are fast ones. You can't pu mp up the tyre at all. The puncture must be mended before you can ride. Riding o n a flat tyre will ruin it. The# first t hing to do is turn the bicycle 2340 DATA upside down. Then you have to decide whether to take out the wheel. I f the puncture is in the front tyre I us ually 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 remov ing 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 th ought! Finding the puncture isn't always easy. Sometimes you pump up the inner t ube 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 o f tiny bubbles. Sometimes the puncture i s so big that the inner tube won't pump up at all. Having# found the puncture it is most important to make the area arou nd it dry and clean. A piece of 2380 DATA fine glass-paper is useful fo r cleaning. Next the area around the pun cture is coated with a layer of rubber s olution. It is essential to leave the ru bber solution for a minute or two to bec ome tacky before removing the 2390 DATA protective film from the patc h and pressing it firmly over the punctu re. There# are two things to do before p utting the inner tube back in the tyre. Firstly put plenty of talcum powder on t he repair or next time you have 2400 DATA a puncture you'll find the in ner tube stuck to the inside of the tyre ! Secondly feel carefully round the insi de of the tyre to find and remove the ob ject 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 mu st 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 b e in Plymouth one evening and in London the next morning. It was an ideal opport unity to find out what it is like to spe nd a night on a British Rail sleeping co ach. The# train left Plymouth 2440 DATA at about midnight. I was shar ing a compartment with a fussy little ma n who was travelling on to Harwich to ca tch a boat. I agreed that when we reache d London he could get up first and use t he washing facilities as he 2450 DATA would not have much time to s pare to catch his next train. I slept on the top bunk and he slept on the bottom one. I# have always prided myself on be ing 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 t he train clanked to a stop which it seem ed 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 t he 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 severa l 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 o f continuous train noise. After five min utes 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 shor t shirt! I became convinced that the tra in had departed in my absence. People we re probably looking at me but I wasn't t oo 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 a nd went off in search of breakfast.* 2599 REM``````````````````````````````` ````````````````````````````````````` 2600 DEFPROCaskcolour 2610 CLS:PRINT TAB(1,1)d$;"Press W if y ou 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 w ould like some of";TAB(1,8)d$;"Press C i f you would like some of";TAB(1,9)d$;"th e print to be coloured.";TAB(1,10)d$;"th e print to be coloured."; 2630 REPEAT:G$=GET$:UNTIL INSTR("WC",G$ )<>0 2640 IF G$="W" THEN g$=CHR$135:m$=CHR$1 35 2650 ENDPROC