home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1995 February
/
1995-02b.d64
/
mapmaker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
15KB
|
384 lines
0 rem copyright 1995 - compute publication intl ltd - all rights reserved
1 poke55,0:poke56,80:clr:goto9000
3 poke51200,0:poke49153,0:poke53280,0:poke53281,0:print"":end
5 poke648,4:poke2,0:sys2
6 fori=1to22:forj=1to9:printi;:next:print:next:print"";: end
2700 rem"[162][162]set colors
2705 x[178]49195:[151]x,c(0):[129]j[178]0[164]3:[151]x[170]1[170]j,c(j):[130]:[151]646,c(5)
2710 [151]53280,c(4):[158]49176:[142]
2800 [143]"newnewmed-res setup
2805 ifh<57orh>252thenh=200
2810 if(peek(789)and240)=192then2850
2815 x=52160:for i=0 to 5*3-1:poke x+i,255:next:fori=ito 63:poke x+i,0:next
2820 v=53248:pokev+21,0:fl=0
2825 for i=0 to 6:poke 53240+i,47
2830 x=i*48+24:pokev+i*2,xand255:ifx>255thenfl=fl+int(2^i)
2835 poke v+39+i,c(4):next:pokev+16,fl:pokev+29,127
2845 poke53269,0:sys49185:sys49167:poke780,252:sys49173:poke 648,204
2850 ifh<251then2880
2860 poke780,h:sys49173:poke53269,0:fori=53249toi+12step2:pokei,h-2:next:return
2880 poke53269,0:fori=53249toi+12step2:pokei,h-2:next:poke53269,127
2885 poke780,h:sys49173:return
3000 rem"[162][162][162][162][162][162]screen list
3010 [141]4600:[139]x[179]0[167][142]
3015 ec[178]x:bp[178]fe(ec):ll[178]fl(ec)
3020 la$[178]" (NULL)ot: # (NULL)atitude (NULL)ongitude valstr$right$(NULL) wait"
3025 lz$[178]"len(NULL)(NULL)-(NULL)croll right$(NULL)(NULL)/str$val(NULL)/(NULL)val(NULL)-valdit (NULL)left$/(NULL)val(NULL)-valxitwait":lc$[178]"len(NULL)(NULL)(NULL)val(NULL)(NULL)>"
3030 [153]"load":[141]3600:[153]"":c[178]1:t[178]8
3035 [129]c[178]1[164]23:[141]3500:[130]:lz[178]c:la[178]1
3045 [151]781,1:[151]782,0:[158]58636:[153]lc$
3050 [151]198,0:[146]198,7:[161]x$:x[178][198](x$):[139]x[178]141[167][153]"load";:[142]
3055 [151]781,1:[151]782,0:[158]58636:[153][200](bl$,[195](lc$))
3060 x[178][171](x[178]145)[171]2[172](x[178]17)[171]3[172](x[178]13)[171]4[172](x[178]148)[171]5[172](x[178]20)
3065 [145]x[141]3100,3200,3300,3150,3250:[137]3045
3100 [143]"newnewcur up
3105 ifla<2thenreturn
3110 poke781,23:sys59903:poke218,132:print"[157]"chr$(148):poke218,132
3115 print"":la=la-1:lz=lz-1:c=la:gosub3500:goto3600
3150 rem"[162][162]insert
3155 [139]fl(ec)[170]4[177]zl[167]3630
3160 x[178]fe(ec)[170]la[172]4:y[178](fl(ec)[171]la[170]2)[172]4:[158]49182,x,x[170]4,y:fl(ec)[178]fl(ec)[170]1:ll[178]ll[170]1
3165 [151]x,48:[151]x[170]1,42:[151]x[170]2,48:[151]x[170]3,42
3170 la[178]la[170]1:lz[178]lz[170]1:[141]3100:[153]"":x[178]lz[171]1:[139]x[177]ll[167]x[178]ll
3175 [129]i[178]la[164]x:[153][163]t)[201](" "[170][196](i),3):[130]:fd(ec)[178]1:[142]
3200 [143]"newnewcur down
3205 ifla>ll-1thenreturn
3210 c=lz:lz=lz+1:la=la+1
3215 poke218,132:poke781,1:sys59903:poke781,24:sys59903:sys59626:gosub3600
3220 poke781,23:poke782,0:sys58636
3225 iflz<ll+2then3500
3230 return
3250 rem"[162][162]delete rec
3255 [139]fl(ec)[179][178]1[176]ll[179][178]la[167][142]
3260 [141]3200:x[178]fe(ec)[170]la[172]4:y[178](fl(ec)[171]la[170]3)[172]4:[158]49182,x,x[171]4,y:fl(ec)[178]fl(ec)[171]1
3265 [153]"":ll[178]ll[171]1:la[178]la[171]1:lz[178]lz[171]1:x[178]lz[171]1:[139]x[177]ll[171]1[167]x[178]ll
3270 [129]i[178]la[164]x:[153][163]t)[201](" "[170][196](i),3):[130]:fd(ec)[178]1:[142]
3300 [143]"newnewenter/edit
3305 fd(ec)=1:c=la:print""lc$:print"";
3310 ifla<llandpeek(t+peek(648)*256+45)<>63thengosub3500:goto3350
3315 ifll*4+30>zmthen3630
3340 fl(ec)=fl(ec)+1:x$="0 0 n 0 0 w":printtab(t)x$
3350 print"":x=t+5:y=6:z=1:gosub3400:a=b:ifx=0then3370
3355 gosub3900:iffthen3375
3360 goto3350
3370 x=t+15:y=16:z=2:gosub3400
3375 p=c*4+bp:pokep,fnl(a):pokep+1,fnh(a):pokep+2,fnl(b):pokep+3,fnh(b)
3380 ifla=llthenll=ll+1:print"";:pokep+5,255:c=ll:gosub3500:c=la:print"[145][145]";
3385 print"[145]":goto3500
3400 rem"[162][162]get d/m/dir-set x,y,z,x$
3410 [153]:[153][163]x)"on";:y$[178][202](x$,y,3):[158]in,y$,y$,11:[139]y$[178]""[167]3410
3413 b[178][197](y$):[139][182]([181](b))[179][177]b[176]b[177]179[167]3410
3414 [139]z[178]1[175]b[177]89[167]3410
3415 [139]b[177]0[176][200](y$,1)[178]"0"[167]3420
3418 [139]z[177]1[167]3420
3419 x[178][171]1:[142]
3420 [153]:[153][163]x[170]4)"on";:y$[178][202](x$,y[170]4,2):[158]in,y$,y$,9:[139]y$[178]""[167]3420
3425 w[178][197](y$):[139][182]([181](w))[179][177]w[176]w[177]59[167]3420
3430 b[178]b[172]60[170]w
3435 [153]:[153][163]x[170]7)"on";:y$[178][202](x$,y[170]7,1):[158]in,y$,y$,2
3440 w[178]0:z$[178]"nwse":[129]i[178]z[164][195](z$)[169]2:w[178]w[171](y$[178][202](z$,i,1))[172]i:[130]
3445 [139]w[178]0[167]3435
3450 b[178]10800[170]b[172]((w[179]3)[171](w[177]2)):x[178]0
3455 [153]:[153]"on";:[142]
3460 [143]"newnewget y->x$ dir
3465 x$="ns":ifz=1then3475
3470 x$="we"
3475 x$=mid$(x$,2+(fnns(y)<0),1)
3480 x$=right$(" "+str$(fnnd(y)),3)+right$(" "+str$(fnnm(y)),3)+" "+x$:return
3500 rem"[162][162]out line c
3505 p[178]bp[170]c[172]4:a[178][165]d(p):[139]c[177]ll[167][153][200](bl$,39):[142]
3510 x$[178][201](" "[170][196](c),3)[170]":close"
3515 [139]c[178]ll[167][153][200](bl$,39):[153]"on"[163]t)x$" -------eof-------":[142]
3520 [139]a[179]16200[175]a[177]5399[167]3525
3522 x[178]a[173]256:[139]x[177]249[175]x[179]256[167][141]3800:x$[178][200](x$[170]y$[170]bl$,39[171]t):[139]f[167]3555
3523 x$[178]x$[170]"? ? ? ? ? ?":p[178]p[171]4:[137]3555
3525 [158]cv,a:x$[178]x$[170][201](" "[170][196]([194](782)),3)[170][201](" "[170][196]([194](780)),3)
3530 x$[178]x$[170]" "[170][202]("sn",[194](781),1)[170]" "
3535 b[178][165]d(p[170]2):[139]b[177]21599[167]a[178]1e9:[137]3510
3540 [158]cv,b
3544 x$[178]x$[170][201](" "[170][196]([194](782)),3)[170][201](" "[170][196]([194](780)),3)
3545 x$[178]x$[170]" "[170][202]("ew",[194](781),1)
3555 p[178]p[170]4:[153][163]t)x$[200](bl$,39[171][195](x$)[171]t):[142]
3600 [143]"newnewset top/botlines
3605 print""la$""fl(ec)-1"[146]"
3610 poke781,24:poke782,0:sys58636:printlz$;:return
3630 rem"[162][162]full list
3635 [153]""[200](bl$,39)""[163]t[170]4)" (NULL)ist ascull wait"
3640 [129]i[178]1[164]1500:[130]:[137]3500
3650 [143]"newnewcreate empty map
3655 gosub4700:ifx<1thenreturn
3660 print"[197]nter [205]ap [206]ame: ";:sysin,left$(bl$,16),x$:ifx$=""thenreturn
3665 x=fs(zc)+1:fori=1tolen(x$):pokex+i,asc(mid$(x$,i,1)):next:pokei+x,160
3670 ft$(zc)=x$:return
3700 rem"[162][162]del map
3705 [141]4600:[139]x[179]0[167][142]
3710 [151]fs(x),0:[139]x[177][178]zc[167]3725
3715 [129]i[178]x[164]zc[171]1:fl(i)[178]fl(i[170]1):fs(i)[178]fs(i[170]1):fe(i)[178]fe(i[170]1):ft$(i)[178]ft$(i[170]1)
3720 fd(i)[178]fd(i[170]1):fx(i)[178]fx(i[170]1):[130]
3725 zc[178]zc[171]1:[142]
3800 [143]"newnewhandle commands x->x$
3805 f=1:y=peek(p+2):y$=mid$(str$(1e3+y),4,2)
3810 ifx>249thenonx-249goto3860,3850,3820,3840,3830
3815 f=0:return
3820 y$="g"+mid$("+xo",y,1)+" graphic character":return
3830 y$="c"+y$+" set curr. color="+y$:return
3840 z$=right$(y$,1):y$="d"+z$+" draw with pen # "+z$:return
3850 y$="pu pick up pen":return
3860 y$="pd put down pen":return
3900 rem"[162][162]enter commands y$->a,b
3905 f[178]1:b[178][197]([202](y$,2,5))
3910 x[178]0:z$[178]"cdgotop":[129]i[178]1[164][195](z$):x[178]x[171]([200](y$,1)[178][202](z$,i,1))[172]i:[130]
3915 [145]x[170]1[137]3920,3925,3935,3945,3960
3920 a[178]0:b[178]0:f[178]0:[142]
3925 [139]b[177]15[176]b[179]0[176]b[179][177][181](b)[167]3920
3930 a[178]254[172]256:[142]
3935 [139]b[177]3[176]b[179]0[176][181](b)[179][177]b[167]3920
3940 a[178]253[172]256:[142]
3945 b[178]0:y$[178][201](y$,1):z$[178]"+xo":[129]i[178]1[164][195](z$):b[178]b[171](y$[178][202](z$,i,1))[172]i:[130]
3950 [139]b[178]0[167]3920
3955 a[178]252[172]256:[142]
3960 y$[178][201](y$,1):[139]y$[178]"u"[167]a[178]251[172]256:[142]
3965 [139]y$[179][177]"d"[167]3920
3970 a[178]250[172]256:[142]
4600 [143]"newnewlists-sel.item x ((NULL)val(NULL)=0)
4605 x=-1:ifzc<1thenprint" [206]o [205]aps in [205]emory [146]":return
4610 x$="[192][192][192] [205]ap [211]election [205]enu [192][192][192]":printtab(38+(40-len(x$))/2)x$""
4615 fori=1tozc:x=fs(i)+2
4625 printtab(12)chr$(i+64)"-"ft$(i):next
4630 print" [211]elect [205]ap (or [208]ress [210][197][212][213][210][206] to [197]xit) [146]"
4635 poke198,0:wait198,7:getx$:x=asc(x$)-64:print"[147]":ifx=-51thenx=-1:return
4640 ifx<1orx>=ithenprin