start tok64 d64-ukef3o 0 RUN00100 1 REM"{delete*6} 2 REM"{delete*6}ponzo*1983*waterloo 3 REM"{delete*6} 100 POKE53281,15:POKE53280,12:PRINT"{black}":PRINT"{clear}{space*13}{reverse on}{blue}c64 tutor-1 101 PRINT"{red}{cm a}{sh asterisk*37}{cm s}" 102 PRINT"{sh -} {reverse on}{blue}{space*12}c64 basics{space*13}{red}{reverse off} {sh -}":ms$=" welcome! " 103 PRINT"{red}{cm z}{sh asterisk*37}{cm x}{black}" 104 sn$="1{0*3}":GOSUB63200:GOSUB63600 105 GOSUB60000:GOSUB63100:GOSUB59000 1000 GOSUB60000 1005 PRINT"{clear}{reverse on}hi{reverse off}! let me tell you about myself." 1010 PRINT"i'm a classy calculator:" 1040 PRINT"{down}i can add: {reverse on}2+2=4{reverse off} subtract:{reverse on}2-3=-1" 1050 PRINT"{down}multiply:{reverse on}3*17=51{reverse off} divide:{reverse on}4/16=.25" 1080 PRINT"{down}i compute sines and logarithms" 1090 PRINT"{down}square roots and arctangents." 1100 PRINT"{down}i raise no's to a power:{reverse on}2^(-3)=.125" 1200 PRINT"{down}type:{reverse on}?2*sin({pi}/3)+log(1.2^3)-sqr(4*5.6)" 1300 PRINT"{down}(the ? in front means print)" 1310 PRINT"{space*5}{cm t}{space*16}{cm t*5}" 1320 PRINT"..hit {reverse on}return{reverse off}..i print the answer!" 1330 PRINT"{down}{reverse on}try it{reverse off}. when finished.." 1331 PRINT"{down}{reverse on}type{space*2}@{reverse off}{arrow left}{sh asterisk*18}" 1332 ms$="{reverse on}@{arrow left}remember{reverse off}":GOSUB63100 1335 sn$="02{0*3}":GOTO63300 2000 PRINT"{clear}":ms$="{space*3}good":GOSUB60000:GOSUB63100:PRINT"{clear}"; 2100 PRINT"{clear}to correct a mistyped symbol " 2110 PRINT"{down}just{space*2}press the key marked {reverse on}del{reverse off}. 2150 PRINT"{space*16}{cm t*3}" 2170 PRINT"suppose you typed 2sin({pi}/3)." 2200 PRINT"{down}to insert a * between 2 and sin({pi}/3)" 2210 PRINT"{down}to indicate multiply{.*4} 2300 PRINT"{down}press shift and del!" 2400 PRINT"{space*6}{cm t*5} {cm y*3} {cm t*3} 2500 PRINT"do this after you have the cursor" 2510 PRINT"{down}over the s in sin." 2600 PRINT"{down}that way you insert a space" 2610 PRINT"{down}to type in '*'." 2800 PRINT"{down}try it! then {reverse on}type{space*2}@" 2990 sn$="03{0*3}":GOTO63300 3000 GOSUB60000:PRINT"{clear}if you want me to remember the" 3010 PRINT"{down}result of some calculation.." 3020 PRINT"{down}then give it a name!" 3030 PRINT"{down}type:{reverse on}sam=2*3/4+5{reverse off}" 3040 PRINT"{down}then i'll remember{space*2}sam." 3050 PRINT"{down}you can ask for the value of sam." 3070 PRINT"{down}type:{reverse on}?sam" 3080 PRINT"{down}you can also type:" 3090 PRINT"{reverse on}joe=sam^2+sin({pi}*sam/3)" 3100 PRINT"{reverse on}?joe{space*18}" 3110 PRINT"{down}then i'll print the value of joe." 3120 PRINT"{down}try it!then type..{space*2}{reverse on}@" 3130 sn$="04{0*3}":GOTO63300 4000 GOSUB60000:PRINT"{clear}ok..if you tell me the values" 4100 PRINT"{down}of a,b & c then type:" 4200 PRINT"{reverse on}y=(-b+sqr(b*b-4*a*c))/(2*a)" 4300 PRINT"{reverse on}?y{space*25}" 4400 PRINT"{down}i'll calculate y and print it." 4500 PRINT"{down}unfortunately, if you give me" 4510 PRINT"{down}new values for a,b & c{.*3}well.." 4600 PRINT"{down}you'll have to retype the formula!" 4800 PRINT"{down}(but wait till we write 'programs')." 4910 PRINT"{down}want to try this?" 4950 PRINT"{down}then:{reverse on}type @{reverse off} to continue." 4955 ms$="@{arrow left}{sh asterisk*8}":GOSUB63100 4970 sn$="05{0*3}":GOTO63300 5000 GOSUB60000:PRINT"{clear}if you give me new values for a,b &c" 5300 PRINT"{down}by typing {reverse on}a=5.3:b=-2.1:c=.011" 5400 PRINT"{down}(you can give me several instr'ns" 5500 PRINT"on the same line,separated by a colon:)" 5700 PRINT"{down}i'll remember these new values" 5710 PRINT"{down}and if you want y recalculated" 5800 PRINT"{down}just move the cursor to the" 5810 PRINT"{down}statement defining y and hit 'return'." 5840 PRINT"{down}i'll think you just typed it in!" 5850 PRINT"{down}then you can ask {reverse on}?y" 5860 PRINT"{down}try it! then {reverse on}type @" 5999 sn$="06{0*3}":GOTO63300 6000 GOSUB60000:PRINT"{clear}now {.*3}my more impressive talent.." 6005 PRINT"{down}{space*5}{reverse on}programs{reverse off}" 6010 PRINT"{space*5}{cm u*8}" 6011 ms$=" ahem{.*3}":GOSUB63100 6015 GOSUB63000 6020 PRINT"{clear}if you give each instruction a 'number'" 6030 PRINT"{down}i'll remember the instruction!" 6040 PRINT"{down}for example, type:" 6050 PRINT"{down}{reverse on}10 y=(a+b)/2" 6060 PRINT"{reverse on}20 ?y{space*7}" 6080 PRINT"{down}#10 says:compute the average of" 6085 PRINT"{down}two numbers a & b, and call it y." 6100 PRINT"{down}#20 says:print the value of y." 6120 PRINT"{down}now i'll 'remember' these instructions!" 6130 PRINT"{down}clear the screen,type {reverse on}a=1.5:b=-4" 6140 PRINT"{down}then {reverse on}goto 10{reverse off}{.*3}i'll obey!" 6150 PRINT"{down}try it!{space*2}then {reverse on}type @" 6160 ms$="{space*2}goto 10":GOSUB63100 6170 sn$="07{0*3}":GOTO63300 7000 GOSUB60000:PRINT"{clear}suppose you want the value of y" 7010 PRINT"{down}printed in the middle of the screen." 7047 PRINT"{down}type:" 7050 PRINT"{down}15?" 7060 PRINT"16?spc("w2$");" 7070 PRINT"{down}#15 says:print nothing..a blank line." 7090 PRINT"{down}#16 says:space right "w2$" places." 7100 PRINT"{down}>the semi-colon after spc("w2$")" 7110 PRINT"{down}says:leave the cursor there!" 7120 PRINT"{down}you see,i normally return the cursor" 7125 PRINT"{down}to the left margin.." 7130 PRINT"{down}unless you include the {reverse on};" 7140 GOSUB63000 7145 PRINT"{clear}{down*2}type statements in any{down}{left*3}{cm u*3}{up} order." 7146 PRINT"{down}i'll remember them in the order" 7147 PRINT"{down}of their statement #'s! you type:" 7160 PRINT"{down}10y=(a+b)/2" 7161 PRINT"20?y{space*7}" 7162 PRINT"15?{space*8}" 7163 PRINT"16?spc("w2$");" 7170 PRINT"{down}i remember them as:" 7171 PRINT"{down} 10 y=(a+b)/2" 7172 PRINT" 15 print" 7173 PRINT" 16 printspc("w2$");" 7174 PRINT" 20 printy" 7180 PRINT"{down}try it!..then type {reverse on}@{reverse off} to go on." 7260 sn$="08{0*3}":GOTO63300 8000 GOSUB60000 8010 PRINT"{clear} 10 y=(a+b)/2{space*6}{cm +}" 8020 PRINT" 15 print{space*10}{cm +}the program" 8030 PRINT" 16 printspc("w2$");{space*2}{cm +}so far" 8040 PRINT" 20 printy{space*9}{cm +}" 8060 PRINT"{down}to convince yourself that i have" 8070 PRINT"{down}all your instructions,in order.." 8090 PRINT"{down}just type:{reverse on}list10-20" 8110 PRINT"{down}i'll print every statement :10 to 20." 8120 PRINT"{down}you can edit statements right" 8125 PRINT"{down}on the screen. just {reverse on}list{reverse off} ..then move" 8140 PRINT"{down}the cursor..then {reverse on}inst/del{reverse off} etc." 8150 PRINT"{down}to check the changes, {reverse on}list{reverse off} again. 8155 PRINT"{down}want to try? (continue with {reverse on}@{reverse off})" 8160 sn$="09{0*3}":GOTO63300 9000 GOSUB60000:ms$="{reverse on}some notes{reverse off}":GOSUB63100 9010 PRINT"{clear}to {reverse on}change{reverse off} a statement" 9020 PRINT"{down}type the no. and the new instruction." 9030 PRINT"(i'll forget the old instruction)." 9040 PRINT"{down}to {reverse on}delete{reverse off} a statement" 9050 PRINT"{down}type the no. then press 'return'!" 9090 PRINT"{down}which reminds me.." 9100 PRINT"{down}{reverse on}do not{reverse off} type in some number.." 9110 PRINT"change your mind{.*3}hit return.." 9120 PRINT"..then reenter the number." 9130 PRINT"you may have wiped out a statement!" 9140 PRINT"{down}note,too,that you may use ?" 9145 PRINT"{down}i will remember it as {reverse on}print{reverse off}." 9160 GOSUB63000 9161 PRINT"{clear}also..i remember only the first two" 9162 PRINT"{down}characters in any {reverse on}name{reverse off} you assign." 9163 PRINT"{down}sam=10" 9164 PRINT"sally=20" 9165 PRINT"{down}to me, {reverse on}both{reverse off} have the same name!" 9166 PRINT"{down}namely {reverse on}sa{reverse off}!" 9167 PRINT"{down}hence sa=10 followed by sa=20 makes" 9168 PRINT"{down}sam=sally=20." 9169 ms$="sam=sally?":GOSUB63100 9170 GOSUB63000 10000 : 10009 PRINT"{clear} in addition to manipulating numbers" 10010 PRINT"{down}i can manipulate {reverse on}strings{reverse off} of symbols." 10020 PRINT"{down}in the same way that you assign a name" 10030 PRINT"{down}to a number,like x or y or sam," 10040 PRINT"{down}you can give a name to a {reverse on}string" 10050 PRINT"{down}of characters." 10060 PRINT"{down}so that i don't become confused" 10070 PRINT"{down}i must know whether 2*3 is a number" 10080 PRINT"{down}or a string of three symbols." 10090 PRINT"{down}hence, i must insist that the name you" 10100 PRINT"{down}give it ends with a $ ..if it's a" 10110 PRINT"{down}string of symbols..like x$,y$ or sam$." 10115 GOSUB63000 10120 PRINT"{clear} you can now try the following:" 10130 PRINT"{down}type:" 10140 PRINT"x=2+3" 10150 PRINT"x$="CHR$(34)"2+3"CHR$(34) 10160 PRINT"?x" 10170 PRINT"?x$" 10180 PRINT"{down*2}{reverse on}..see what i'll print{reverse off}?" 10195 PRINT"{down*2}then type {reverse on}@{reverse off} to continue.":ms$="{space*3}{?*4}{space*3}":GOSUB63100 10200 sn$="11{0*3}":GOTO63300 11000 GOSUB60000 11010 PRINT"you guessed it!" 11020 PRINT"i'll print:" 11030 PRINT:PRINT" 5" 11040 PRINT"2+3":PRINT 11045 GOSUB63000 11050 PRINT"{clear} now what do you think x$+y$ means?" 11060 PRINT"{down}try typing:":PRINT 11070 PRINT"{down}a$="CHR$(34)"i"CHR$(34) 11080 PRINT"b$="CHR$(34)"you"CHR$(34) 11090 PRINT"y$="CHR$(34)"am great!"CHR$(34) 11100 PRINT"z$="CHR$(34)"are too?"CHR$(34) 11110 PRINT"{down}then ask me:" 11120 PRINT"{down}?a$+y$" 11130 PRINT"?b$+z$" 11140 PRINT"{down}try it!{space*2}then type {reverse on}@" 11145 ms$="{space*2}great?{space*2}":GOSUB63100 11150 sn$="12{0*3}":GOTO63300 12000 GOSUB60000:PRINT"{clear}well..if you tried it you'll notice"" 12010 PRINT"{down}that a$ stands for {reverse on}everything{reverse off} inside" 12020 PRINT"{down}the quotes. if you want a space" 12030 PRINT"{down}after i..then include the space too!" 12040 PRINT"{space*6}{cm t}" 12045 PRINT"{down*2}a$="CHR$(34)"i "CHR$(34) 12046 PRINT"{space*5}^" 12047 PRINT"{space*5}see?" 12048 GOSUB63000 12050 PRINT"{clear}ok..let's work all this into a program." 12060 PRINT"let's type:" 12070 PRINT"{down}10?"CHR$(34)"calculation of the hypotenuse"CHR$(34) 12080 PRINT"20?"CHR$(34)"enter side a"CHR$(34) 12090 PRINT"30 input a" 12100 PRINT"40?"CHR$(34)"enter side b"CHR$(34) 12110 PRINT"50 input b" 12120 PRINT"60 c=sqr(a*a+b*b):?"CHR$(34)"hyp="CHR$(34)"c" 12130 PRINT"70 go to 20" 12140 PRINT"{down}the only thing new is {reverse on}input{reverse off}." 12170 PRINT"{down}at statement#30 i'll wait for you" 12180 PRINT"{down}to type in a number, and{space*2}i'll call" 12190 PRINT"{down}the number a,if you say {reverse on}inputa{reverse off}." 12300 PRINT"{down}try it!(then type {reverse on}@{reverse off})" 12305 ms$="hypo/what?":GOSUB63100 12310 sn$="13{0*3}":GOTO63300 13000 GOSUB60000:PRINT"{clear}suppose you want the squares" 13010 PRINT"{down}of the integers from 1 to 100." 13020 PRINT"{down}you could type:" 13030 PRINT"{down}{reverse on}10 ?1*1" 13040 PRINT"{reverse on}20 ?2*2{reverse off}{space*3}etc.etc." 13060 PRINT"{down}or,you could repeat the instruction:" 13070 PRINT"{down}{reverse on}10 ?n*n{reverse off}" 13080 PRINT"{down}again & again,for n=1 then n=2..etc." 13090 PRINT"{down}to do this you put the instruction to " 13100 PRINT"{down}be repeated within a {reverse on}for-next{reverse off} loop:" 13120 PRINT"{down}{reverse on}10 for n=1 to 100{reverse off} {arrow left}here's the "CHR$(34)"for"CHR$(34) 13130 PRINT"{reverse on}20 ?n*n{space*10}" 13140 PRINT"{reverse on}30 next{space*10}{reverse off} {arrow left}here's the "CHR$(34)"next"CHR$(34) 13150 GOSUB63000:PRINT"{clear}" 13160 ms$=" watch!!{space*2}":GOSUB63100 14000 GOSUB60000:PRINT"{clear}how's this for a diversion?" 14010 FORt=1TO500:NEXT:PRINT"{clear}" 14020 FORi=1TO2 14030 FORj=1TOwd-1:FORt=1TO5:NEXT 14040 PRINT" *{left}";:NEXT 14050 FORj=1TOwd-1:FORt=1TO5:NEXT 14060 PRINT" {left*2}*{left}";:NEXT 14070 FORj=1TOwd:FORt=1TO5:NEXT 14080 PRINT"*";:NEXT:NEXT 14090 GOSUB63000 14100 PRINT"{clear}":ms$="{space*2}{reverse on}nice !{reverse off}{space*2}":GOSUB60000:GOSUB63100:PRINT"{clear}"; 14150 PRINT"{down}let's try it!" 14160 PRINT"{down}there will be 4 {reverse on}for-next{reverse off} loops." 14170 PRINT"{down}{reverse on}1{reverse off}:"w3$" movements to the right." 14180 PRINT"{down}{reverse on}2{reverse off}:"w3$" to the left.." 14190 PRINT"{down}(each of the above will print a new *" 14200 PRINT"{down}and erase the old *..giving the 14210 PRINT"{down}appearance of motion)." 14220 PRINT"{down}{reverse on}3{reverse off}:then, right again (but without" 14221 PRINT"{down}erasing) leaving the *'s." 14230 PRINT"{down}{reverse on}4{reverse off}:then{down}{left*4}{cm u*4}{up} all 3 loops will be repeated" 14231 PRINT"{down}2 times,for 2 lines!" 14245 GOSUB63000 14250 PRINT"{clear}{down*5}{reverse on}here we go!" 14260 FORi=1TO500:NEXT 14280 PRINT"{clear}assume the cursor is 'over' a *." 14290 PRINT"{down}to erase we type 'space'.." 14300 PRINT"{down}then *,then a 'cursor-left'" 14320 PRINT"{down}(leaving the cursor again 'over' {reverse on}*{reverse off})." 14350 PRINT"{down}10?"CHR$(34)" *{left}"CHR$(34) 14360 PRINT"{space*6}^" 14365 PRINT"{space*6}this is {reverse on}cursor-left{reverse off}!" 14390 PRINT"{down}repeat these inst'ns "w3$" times" 14400 PRINT"{down}with a {reverse on}for-next" 14410 PRINT"{down}like so:":PRINT 14420 PRINT"{down}9 for i=1 to "w3$ 14430 PRINT"10?"CHR$(34)" *{left}"CHR$(34) 14440 PRINT"11 next"; 14450 GOSUB63000 14451 PRINT"{clear}9 for i=1 to "w3$"{space*2}{cm +}" 14452 PRINT"10?"CHR$(34)" *{left}"CHR$(34)"{space*9}{cm +} we have this so far" 14453 PRINT"11 next{space*10}{cm +}" 14470 PRINT"{down}now you'd type:" 14480 PRINT"{down}19 for i=1 to"w3$ 14490 PRINT"20?"CHR$(34)" {left*2}*{left}"CHR$(34) 14500 PRINT"21 next" 14520 PRINT"{down}note the sequence of print inst'ns:" 14530 PRINT"{down}{reverse on}space{reverse off}-{reverse on}c'sorleft{reverse off}-{reverse on}c'sorleft{reverse off}-{reverse on}*{reverse off}-{reverse on}c'sorleft{reverse off}" 14540 PRINT"{down}now we have * moving to the right," 14550 PRINT"{down}and{down}{left*3}{cm u*3}{up} to the left," 14560 PRINT"{down}now:" 14570 PRINT"{down}29fori=1to"w1$ 14580 PRINT"30?"CHR$(34)"*"CHR$(34) 14590 PRINT"31next" 14600 GOSUB63000 14610 PRINT"{clear}note that you needn't leave all those" 14620 PRINT"{down}blank spaces in the inst'ns." 14630 PRINT"{down}(me smart fellow!)" 14640 PRINT"{down}anyway..the last for-next loop" 14650 PRINT"{down}repeats all the above twice!" 14660 PRINT"{space*8}{cm t*3} " 14670 PRINT"{down}so you'd type:" 14680 PRINT"{down}5forj=1to2{space*3}{arrow left}first statement" 14690 PRINT"40next{space*7}{arrow left}last statement" 14700 GOSUB63000 14800 PRINT"{clear}now our program(programme?){reverse on}list{reverse off}s like:" 14810 PRINT"{down} 5 forj=1to2" 14820 PRINT" 9 fori=1to"w3$ 14830 PRINT" 10 print"CHR$(34)" *{left}"CHR$(34) 14840 PRINT" 11 next" 14850 PRINT" 19 fori=1to"w3$ 14860 PRINT" 20 print"CHR$(34)" {left*2}*{left}"CHR$(34) 14870 PRINT" 21 next" 14880 PRINT" 29 fori=1to"w1$ 14890 PRINT" 30 print"CHR$(34)"*"CHR$(34) 14900 PRINT" 40 next" 14901 PRINT" 40 next" 14920 PRINT"{down}note that we use "CHR$(34)"j"CHR$(34) 14930 PRINT"{down}for the loop that repeats for 2 lines." 14940 PRINT"{down}(that is, the outermost loop)." 14950 PRINT"{down}within this loop {reverse on}don't{reverse off} use {reverse on}j{reverse off} again!" 14965 PRINT"{down}(so we used {reverse on}i{reverse off})" 14971 GOSUB63000 14980 PRINT"{clear}{down*3} 5 forj=1to2" 14981 PRINT" 9 fori=1to"w3$ 14982 PRINT" 10 print"CHR$(34)" *{left}"CHR$(34) 14983 PRINT" 11 next i{space*7}{arrow left}{sh asterisk*3}note" 14984 PRINT" 19 fori=1to"w3$ 14985 PRINT" 20 print"CHR$(34)" {left*2}*{left}"CHR$(34) 14986 PRINT" 21 next i{space*7}{arrow left}{sh asterisk*3}note" 14987 PRINT" 29 fori=1to"w1$ 14988 PRINT" 30 print"CHR$(34)"*"CHR$(34) 14989 PRINT" 31 next i{space*7}{arrow left}{sh asterisk*3}note" 14990 PRINT" 40 next j{space*7}{arrow left}{sh asterisk*3}note" 14991 PRINT"{down}if you get confused with" 14992 PRINT"{down}all those {reverse on}next{reverse off}s{.*3}" 14995 PRINT"{down}type: {reverse on}next i{reverse off} & {reverse on}next j" 14998 GOSUB63000 15000 PRINT"{clear}{reverse on}want to try{reverse off}?" 15010 PRINT"{down}i'll repeat the instructions." 15115 PRINT"{down}you can enter the inst'ns by putting" 15116 PRINT"{down}the cursor at the first instr'n" 15117 PRINT"{down}then repeatedly pressing 'return'" 15118 PRINT"{down}so i'll think {reverse on}you{reverse off} typed them in." 15120 GOSUB63000 15810 PRINT"{clear}";:PRINT"5forj=1to2" 15820 PRINT"9fori=1to"w3$ 15830 PRINT"10?"CHR$(34)" *{left}"CHR$(34) 15840 PRINT"11next" 15850 PRINT"19fori=1to"w3$ 15860 PRINT"20?"CHR$(34)" {left*2}*{left}"CHR$(34) 15870 PRINT"21next" 15880 PRINT"29fori=1to"w1$ 15890 PRINT"30?"CHR$(34)"*"CHR$(34) 15900 PRINT"31next" 15901 PRINT"40next" 15905 PRINT"{down}after entering statements 5-40 type:" 15906 PRINT"{down}{reverse on}run{reverse off} to run your programme." 15910 PRINT"{down}(type {reverse on}@{reverse off} to continue tutor 1).":sn$="16{0*3}":GOTO63300 16000 GOSUB60000:PRINT"{clear}{reverse on}doesn't work does it?" 16001 GOSUB18000 16005 PRINT"{clear}now suppose you'd like to specify" 16010 PRINT"{down}the symbol used..instead of *." 16120 PRINT"{down}in the program, replace * in " 16130 PRINT"{down}statements #10,20&30 by,say,s$" 16140 PRINT"{down}then include the statements:" 16150 PRINT"{down}3?"CHR$(34)"symbol?"CHR$(34) 16160 PRINT"4 input s$" 16170 PRINT"{down}now i'll wait for you to enter the" 16180 PRINT"{down}symbol(or string)which is later" 16190 PRINT"{down}referred to as s$." 16195 GOSUB63000 16200 PRINT"{clear}another thing.." 16210 PRINT"{down}you will want to clear the " 16220 PRINT"{down}screen at the start of the prog'm" 16230 PRINT"{down}so start with:" 16240 PRINT"{down}1?"CHR$(34)"{clear}"CHR$(34) 16250 PRINT"{down}this says: print a clr" 16260 PRINT"{space*19}{cm t*3}" 16261 GOSUB63000 16270 PRINT"{clear}also, you won't want me to come back" 16280 PRINT"{down}with my "CHR$(34)"ready"CHR$(34) 16290 PRINT"{space*9}{cm t*5}" 16300 PRINT"{down}so give me something to do,like:" 16310 PRINT"{down}{reverse on}50 fori=1to5{0*3}:g=0:next" 16320 PRINT"{down}that way i'll go away and set g=0" 16330 PRINT"{down}5{0*3} times!" 16335 PRINT"{down}..or you could have:" 16336 PRINT"{down}{reverse on}50 go to 50" 16337 PRINT"{down}then i'd 'loop' on statement#50 and" 16338 PRINT"{down}to stop me you'd hit {reverse on}stop{reverse off}." 16350 GOSUB63000 16370 PRINT"{clear}another thing,you may want to change" 16380 PRINT"{down}your mind about the no. of lines" 16390 PRINT"{down}printed(instead of always 2)" 16400 PRINT"{down}so change: {reverse on}for j=1to 2" 16410 PRINT"{down}to read:{space*3}{reverse on}for j=1to l" 16420 GOSUB63000 16430 PRINT"{clear}of course you'll have to input"CHR$(34)"l"CHR$(34) 16440 PRINT"{down}so insert the statement:" 16450 PRINT"{down}{reverse on}2 input"CHR$(34)"lines="CHR$(34)";l" 16470 PRINT"{down}i'll print the prompting remark:" 16480 PRINT"{down}lines=?" 16481 PRINT"{down}and will wait for l to be typed in." 16490 GOSUB63000 16500 PRINT"{clear}then you may want to use my classy" 16510 PRINT"{down}"CHR$(34)"reverse field"CHR$(34) 16520 PRINT" {cm t*13}" 16530 PRINT"{down}..that's {reverse on}ctrl-9{reverse off}={reverse on}rvs on" 16550 PRINT"{down}so insert this print command" 16560 PRINT"{down}at the beginning of each print" 16561 PRINT"{down}sequence." 16570 GOSUB63000 16580 PRINT"{clear}replace:" 16590 PRINT"{down} ?"CHR$(34)" *{left}"CHR$(34); 16600 PRINTSPC(5)"{down}{space*2}..by:" 16610 PRINT"{down} ?"CHR$(34)"{reverse on} *{left}"CHR$(34) 16615 PRINT"{space*3}^" 16616 PRINT"that's a 'rvs' command!" 16620 GOSUB63000 16630 PRINT"{clear}{down*3}i'll print lots of things in" 16640 PRINT"{space*2}reverse field" 16650 PRINT"{space*2}{cm t*13}" 16660 PRINT" so if you want it "CHR$(34)"off"CHR$(34) 16670 PRINT"{space*2}insert a print command:" 16680 PRINT:PRINT"41?"CHR$(34)"{reverse off}"CHR$(34) 16690 PRINT"{space*4}^ that's {reverse on}rvs off{reverse off}!" 16845 GOSUB63000 16850 PRINT"{clear}then..if you want to slow things down" 16860 PRINT"{down}try {reverse on}subroutines{reverse off}!" 16870 PRINT"{down}include a few 'gosub500' statements" 16880 PRINT"{down}and i'll go to statement 500 and obey" 16890 PRINT"{down}the instructions there." 16900 PRINT"{down}so, put instructions at 500:" 16910 PRINT"{down}{reverse on}500 fort=1 to1{0*3}" 16920 PRINT"{reverse on}510 next{space*9}" 16930 PRINT"{reverse on}520 return{space*7}" 16940 PRINT"{down}after doing 'nothing' 1{0*3} times i'll" 16950 PRINT"{down}'return' to continue the main program." 16960 GOSUB63000:GOTO19000 18000 PRINT"{down}of course we forgot to include all" 18010 PRINT"{down}those semi-colons{!*3}" 18020 PRINT"{space*6}{cm t*11}{space*2}" 18030 PRINT"{down}so end each print statement" 18040 PRINT"{down}..namely #10,#20 & #30{.*3}" 18050 PRINT"{down}with a semi-colon!{space*3};" 18060 PRINT"{down}but first, let's forge ahead!":GOSUB63000:PRINT"{clear}" 18065 ms$="go!go!go!" 18070 GOSUB63100 18075 RETURN 19000 PRINT"{clear}";:PRINT"1?"CHR$(34)"{clear}"CHR$(34) 19010 PRINT"2input"CHR$(34)"lines="CHR$(34)";l" 19020 PRINT"3?"CHR$(34)"symbol?"CHR$(34) 19030 PRINT"4inputs$" 19810 PRINT"5forj=1tol" 19820 PRINT"9fori=1to"w3$":gosub500" 19830 PRINT"10?"CHR$(34)"{reverse on} "CHR$(34)"s$"CHR$(34)"{left}"CHR$(34)";" 19840 PRINT"11next" 19850 PRINT"19fori=1to"w3$":gosub500" 19860 PRINT"20?"CHR$(34)"{reverse on} {left*2}"CHR$(34)"s$"CHR$(34)"{left}"CHR$(34)";" 19870 PRINT"21next" 19880 PRINT"29fori=1to"w1$":gosub500" 19890 PRINT"30?"CHR$(34)"{reverse on}"CHR$(34)"s$;" 19900 PRINT"31next" 19901 PRINT"40next":PRINT"50goto1" 19902 PRINT"500fort=1to5:next:return" 19910 PRINT"{down}type it in & {reverse on}run{reverse off} to run it." 19930 PRINT"{down}then {reverse on}type @{reverse off} to continue":sn$="2{0*4}":GOTO63300 20000 GOSUB60000:PRINT"{clear}a final word (..or two..):" 20010 PRINT"{down}sometimes you run a program with:" 20020 PRINT"{down}{reverse on}run 10" 20030 PRINT"{down}sometimes with:" 20040 PRINT"{down}{reverse on}goto10" 20050 PRINT"{down}what's the difference?" 20060 PRINT"{down}well..if you type {reverse on}run..{reverse off} i forget" 20070 PRINT"{down}the values of 'x' and 'y' and 'sam'" 20080 PRINT"{down}and will start from scratch." 20090 PRINT"{down}{reverse on}goto..{reverse off} and i'll remember them!" 20100 GOSUB63000 20110 PRINT"{clear}this is handy:" 20120 PRINT"{down}{reverse on}stop{reverse off} a program while it's running" 20130 PRINT"{down}and type:" 20140 PRINT"{down}?x:?y:?sam" 20150 PRINT"{down}and i'll print the values of these" 20160 PRINT"{down}variables at the time i was {reverse on}stop{reverse off}ped." 20170 PRINT"{down}you can type {reverse on}cont{reverse off} to continue" 20180 PRINT"{down}where i left off{.*3}or.." 20190 PRINT"{down}{reverse on}goto100{reverse off} to continue at statement 100" 20200 PRINT"{down}without forgetting 'x' and 'y' etc." 20210 PRINT"{cm u*7}" 20220 GOSUB63000 20230 PRINT"{clear}":ms$="{reverse on}au revoir!{reverse off}":GOSUB63100:GOSUB63500:END 59000 PRINT"{clear}" 59001 PRINT"{home}during the tutorial you may wish" 59002 PRINT"{down}to return to an earlier 'page'." 59003 PRINT"{down}just {reverse on}hit the @-key{reverse off}, at any time," 59004 PRINT"{down}and the tutorial will back up" 59005 PRINT"{down}a page or two." 59006 PRINT"{down}also, you have an opportunity to" 59007 PRINT"{down}compose your own programs." 59008 PRINT"{down}when you wish to continue with" 59009 PRINT"{down}the tutorial, {reverse on}hit the @-key{reverse off}!":GOSUB63000 59010 ms$="{reverse on}@{reverse off}{arrow left}remember":GOSUB63100 59020 GOSUB63000:RETURN 60000 POKE204,1:REM initialize 60001 bt$="{home}":FORi=1TO24:bt$=bt$+"{down}":NEXT 60002 pt$="{red}{cm a}{sh asterisk*10}{cm s}{down}{left*12}{sh -}{right*10}{sh -}{down}{left*12}{cm z}{cm r}{sh asterisk*8}{cm r}{cm x}" 60003 pt$=pt$+"{down}{left*13}N{cm t*12}M{down}{left*14}{cm g}{=*12}{cm m}" 60004 pt$=pt$+"{down}{left*14}PO{cm t*10}PO{up*4}{left*12}" 60005 pt$=bt$+"{up*6}{right*26}"+pt$+"{black}" 60007 ml$="{home}{down*9}{right*27}" 60008 wd=40:crt=1024:PRINTCHR$(142) 60009 w2=wd/2:w3=wd-1:w1$=MID$(STR$(wd),2): 60010 w2$=MID$(STR$(w2),2):w3$=MID$(STR$(w3),2) 60020 PRINT"{clear}":POKE53281,15:POKE53280,12:PRINT"{black}" 60998 IFPEEK(789)<>7*16+15THENSYS(7*4096+15*256+12*16+3) 60999 RETURN 61000 REM*new workspace 61001 m=7*4096+15*256+15*16 61002 RESTORE 61003 FORi=mTOm+15:READk:POKEi,k:NEXT 61004 DATA 1,96,3,96,3,96,3,96 61005 DATA 144,127,0,0,144,127,0,0 61006 m=6*4096:FORi=0TO2:POKEm+i,0:NEXT 61007 RETURN 63000 PRINT"{home}{down*24}hit {reverse on}return{reverse off} to continue"; 63001 GETa$:IFa$<>""THEN63001 63002 GETa$:IFa$=""THEN63002 63003 RETURN 63100 FORt=1TO5:PRINTpt$ms$; 63101 PRINTpt$"{space*10}"; 63102 PRINTpt$ms$;:NEXT 63103 PRINT:RETURN 63200 POKE56,96:POKE52,96:POKE55,0:POKE51,0:GOSUB61000 63201 wd=40:PRINTCHR$(142) 63202 m=7*4096+15*256+9*16 63203 FORi=mTOm+91:READk:POKEi,k:NEXT 63204 DATA165,203,201,46,208,83,32,195,127,165,44,201,8,240,3,32,177,127,32 63205 DATA142,166,165,44,201,8,240,3,76,128,164,76,174,167,162,16,189,239 63206 DATA127,72,181,42,157,239,127,104,149,42,202,208,241,96,120,173,238,127 63207 DATA77,20,3,141,20,3,173,239,127,77,21,3,141,21,3,88,96,173,20,3,73 63208 DATA144,141,238,127,173,21,3,73,127,141,239,127,96,76,255,255 63216 POKEm+90,PEEK(788):POKEm+91,PEEK(789) 63220 key=7*4096+15*256+13*16+8 63221 SYS(key):REM key for irq swap 63299 RETURN 63300 REM*switch to new workspace 63301 GOSUB63600:REM run number 63302 GOSUB61000:REM new the workspace 63303 GOTO63403 63400 REM*switch to old workspace 63401 GOSUB63600 63403 swtch=7*4096+15*256+9*16+15 63404 SYS(swtch):REM swap pointers 63405 POKE204,2:END 63500 REM*restore pet 63501 sn$="100":GOSUB63600 63502 m=7*4096+15*256+12*16+3:IFPEEK(789)=7*16+15THENSYSm 63503 RETURN 63600 REM*insert run number 63601 m=2059:sn$="{0*5}"+sn$ 63602 FORi=1TO5:POKEm-i,ASC(RIGHT$(sn$,i)):NEXT:RETURN stop tok64 (bastext 1.0)