home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1994 December
/
1994-12b.d64
/
sort64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
1KB
|
46 lines
100 data 169,0,141,178,3,24,165,47,105,7,133,34,165,48,105,0
110 data 133,35,160,0,177,34,141,179,3,32,167,3,165,38,133,36
120 data 165,39,133,37,24,165,34,105,3,133,34,165,35,105,0
130 data 133,35,160,0,177,34,205,179,3,208,43,32,167,3,164,40
140 data 177,38,209,36,144,9,208,213,200,196,41,144,243,176,206
150 data 160,0,177,36,170,177,38,145,36,138,145,38,200,204,179,3
160 data 144,240,140,178,3,176,183,173,178,3,208,150,96
170 data 200,177,34,133,38,200,177,34,133,39,96
200 for j=828 to 945
210 read x:t=t+x
220 poke j,x
230 next j
240 if t<>12739 then stop
300 rem: m/l bubble sort 64 only
310 rem: jim butterfield 1994
400 dim f$(300)
410 print "[144]reading data on height of waterfalls:"
420 open 1,8,2,"0:falls"
430 n=0
440 input#1,f$(n)
450 print f$(n)
460 if len(f$(n))<>30 then print " *** file record is wrong length!"
470 n=n+1
480 if st=0 goto 440
490 close 1
500 print
510 print "sort waterfall data by:"
520 print "1. name"
530 print "2. country"
540 print "3. height"
550 print "4. quit"
560 get x$
570 if x$<"1" or x$>"4" goto 560
580 x=val(x$)
590 if x=4 then end
600 if x=1 then a=0:b=14
610 if x=2 then a=14:b=26
630 if x=3 then a=26:b=30
640 poke 40,a:poke 41,b:sys 828
650 for j=0 to n
660 print f$(j)
670 next j
672 print"press any key..."
675 geta$:if a$=""then675
680 goto 500