home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 December / 1994-12b.d64 / sort64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  46 lines

  1. 100 data 169,0,141,178,3,24,165,47,105,7,133,34,165,48,105,0
  2. 110 data 133,35,160,0,177,34,141,179,3,32,167,3,165,38,133,36
  3. 120 data 165,39,133,37,24,165,34,105,3,133,34,165,35,105,0
  4. 130 data 133,35,160,0,177,34,205,179,3,208,43,32,167,3,164,40
  5. 140 data 177,38,209,36,144,9,208,213,200,196,41,144,243,176,206
  6. 150 data 160,0,177,36,170,177,38,145,36,138,145,38,200,204,179,3
  7. 160 data 144,240,140,178,3,176,183,173,178,3,208,150,96
  8. 170 data 200,177,34,133,38,200,177,34,133,39,96
  9. 200 for j=828 to 945
  10. 210 read x:t=t+x
  11. 220 poke j,x
  12. 230 next j
  13. 240 if t<>12739 then stop
  14. 300 rem:  m/l bubble sort  64 only
  15. 310 rem:  jim butterfield  1994
  16. 400 dim f$(300)
  17. 410 print "[144]reading data on height of waterfalls:"
  18. 420 open 1,8,2,"0:falls"
  19. 430 n=0
  20. 440 input#1,f$(n)
  21. 450 print f$(n)
  22. 460 if len(f$(n))<>30 then print " *** file record is wrong length!"
  23. 470 n=n+1
  24. 480 if st=0 goto 440
  25. 490 close 1
  26. 500 print
  27. 510 print "sort waterfall data by:"
  28. 520 print "1. name"
  29. 530 print "2. country"
  30. 540 print "3. height"
  31. 550 print "4. quit"
  32. 560 get x$
  33. 570 if x$<"1" or x$>"4" goto 560
  34. 580 x=val(x$)
  35. 590 if x=4 then end
  36. 600 if x=1 then a=0:b=14
  37. 610 if x=2 then a=14:b=26
  38. 630 if x=3 then a=26:b=30
  39. 640 poke 40,a:poke 41,b:sys 828
  40. 650 for j=0 to n
  41. 660 print f$(j)
  42. 670 next j
  43. 672 print"press any key..."
  44. 675 geta$:if a$=""then675
  45. 680 goto 500
  46.