home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 134 / 134.d81 / sort.cat (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  569b  |  18 lines

  1. 10 dv=peek(186):ifdv<8thendv=8
  2. 20 printchr$(14):close15:open15,dv,15:dimb$(40,1):open2,dv,2,"0:categories,s,r":gosub1000
  3. 30 v=0:fori=1to40:forj=0to1:input#2,b$(i,j):ifb$(i,0)="-1"thenv=i-1:i=40
  4. 40 next:next:close2
  5. 50 s=0:fori=1tov-1:ifb$(i,0)<b$(i+1,0)then75
  6. 60 b$(0,0)=b$(i,0):b$(0,1)=b$(i,1):b$(i,0)=b$(i+1,0):b$(i,1)=b$(i+1,1):
  7. 70 b$(i+1,0)=b$(0,0):b$(i+1,1)=b$(0,1):s=1
  8. 75 next:ifsthen50
  9. 80 fori=1tov:forj=0to1:printb$(i,j),:next:print:next
  10. 90 print#15,"s0:categories":gosub1000
  11. 100 close2:open2,dv,2,"0:categories,s,w":gosub1000
  12. 110 fori=1tov:forj=0to1:print#2,b$(i,j):gosub1000
  13. 120 next:next:print#2,"-1":print#2,"0":close2:close15:end
  14. 1000 input#15,er,em$,et,es
  15. 1010 ifer<20then1030
  16. 1020 printer;em$;et;es:stop
  17. 1030 return
  18.