home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disc 35
/
Commodore_Disc_35_19xx_-_de.d64
/
select-sort.int
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
393b
|
14 lines
100 input"anzahl der werte";d:print
110 dim e%(d),a%(d)
120 fori=1tod:e%(i)=int(rnd(1)*32768):a%(i)=e%(i):next
130 at=ti:gosub190:at=ti-at
140 fori=1tod:printe%(i),a%(i):next
150 print:printat:end
160 rem ------------------------------
170 rem selekt-sort integer
180 rem ------------------------------
190 forj=2tod:vw=a%(j-1):a=j-1:fori=jtod
200 ifa%(i)<vwthenvw=a%(i):a=i
210 nexti:a%(a)=a%(j-1):a%(j-1)=vw:nextj:return
220 rem ------------------------------