home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1986 April / 64er_Magazin_86-04_1986_Markt__Technik_de.d64 / disk-optimizer (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  893b  |  38 lines

  1. 40 ap=200
  2. 50 dl=20
  3. 60 dimb(ap),e(ap),z(ap),gs(ap,dl)
  4. 80 gosub140
  5. 90 gosub210
  6. 100 gosub300
  7. 110 gosub350
  8. 120 goto90
  9. 140 print"[147] disk-optimizer:":print" [197][197][197][197][197][197][197][197][197][197][197][197][197][197][197]":input" summe =";s
  10. 150 print"bei fehlern '0' eingeben.":print"ende: '999'":print
  11. 160 az=az+1:print" zahl"az;:inputb(az)
  12. 170 ifb(az)=0thenaz=az-2:print"[145][145]";:goto160
  13. 180 ifb(az)<>999goto160
  14. 190 az=az-1
  15. 200 print"[147]summe   :"s:print"zahlen  :";az:return
  16. 210 v=v+1:print"versuch :"v
  17. 220 getb$:ifb$="s"thenrun
  18. 230 fori=1tot:b(z(i))=e(i):next:t=0:bs=0
  19. 240 z%=rnd(1)*az+1:ifb(z%)=0goto240
  20. 250 bs=bs+b(z%):t=t+1:e(t)=b(z%):b(z%)=0:z(t)=z%
  21. 260 ifbs>sgoto210
  22. 270 ifbs=sthenreturn
  23. 280 ift=azthenprint"summe aller zahlen ist kleiner als";s:end
  24. 290 goto240
  25. 300 g=t-1:forx=gto1step-1
  26. 310 f=0:fory=1tog:ife(y)<=e(y+1)goto330
  27. 320 f=y:m=e(y):e(y)=e(y+1):e(y+1)=m
  28. 330 nexty:g=f:iff=0thenreturn
  29. 340 nextx:return
  30. 350 fora=1togs:forb=1tot
  31. 360 ifgs(a,b)<>e(b)thenb=t:nextb,a:goto380
  32. 370 nextb:return
  33. 380 printchr$(19):gs=gs+1:fori=1torz+3:print:next
  34. 390 fori=1tot:gs(gs,i)=e(i):printe(i);:next
  35. 400 rz=rz+1:ifrz<20thenreturn
  36. 410 geta$:ifa$=""goto410
  37. 420 rz=0:goto200
  38.