home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disc 35 / Commodore_Disc_35_19xx_-_de.d64 / select-sort.int (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  393b  |  14 lines

  1. 100 input"anzahl der werte";d:print
  2. 110 dim e%(d),a%(d)
  3. 120 fori=1tod:e%(i)=int(rnd(1)*32768):a%(i)=e%(i):next
  4. 130 at=ti:gosub190:at=ti-at
  5. 140 fori=1tod:printe%(i),a%(i):next
  6. 150 print:printat:end
  7. 160 rem ------------------------------
  8. 170 rem selekt-sort integer
  9. 180 rem ------------------------------
  10. 190 forj=2tod:vw=a%(j-1):a=j-1:fori=jtod
  11. 200 ifa%(i)<vwthenvw=a%(i):a=i
  12. 210 nexti:a%(a)=a%(j-1):a%(j-1)=vw:nextj:return
  13. 220 rem ------------------------------
  14.