home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1987 October / 64er_Magazin_87-10_1987_Markt__Technik_de.d64 / fr.berge (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  2KB  |  83 lines

  1. 10 rem ****************************
  2. 20 rem *      fraktale berge      *
  3. 30 rem * 1987 by stefan vilsmeier *
  4. 40 rem ****************************
  5. 50 :
  6. 60 if a=0 then a=1:load "fractal.obj",8,1
  7. 70 dim h%(128,128)
  8. 80 open 1,8,15,"u9":close 1: rem diese zeeile kann bei problemen mit dem
  9. 90 rem floppyspeeder weggelassen werden!
  10. 100 poke53280,0:poke53281,0
  11. 110 input "[147]grad ";g
  12. 120 rem *********** variablen *****
  13. 130 w=128:d=.5:h=128:u=180:r=10:ge=2.25:n=0
  14. 200 rem ********* anfangswerte ****
  15. 210 rem (koennen variiert werden)
  16. 220 h%(0,0)=0
  17. 230 h%(128,0)=0
  18. 240 h%(0,128)=0
  19. 250 h%(64,0)=0
  20. 260 h%(0,64)=0
  21. 270 h%(64,64)=0
  22. 300 rem ********* grafik ein ******
  23. 310 sys50176,14,0:sys50179,1:sys50194
  24. 350 :
  25. 360 :
  26. 370 rem ****************************
  27. 380 rem *     berge berechnen      *
  28. 390 rem ****************************
  29. 400 :
  30. 410 for m=1 to g
  31. 420 :br=w*5:w2=w/2
  32. 430 :for t=0 to 127 step w
  33. 440 : for i=0 to 127-t step w
  34. 450 :  b=(h%(i,t)+h%(i+w,t))/2
  35. 460 :   h%(i+w2,t)=b+(rnd(1)-d)*br
  36. 470 :  b=(h%(t,i)+h%(t,i+w))/2
  37. 480 :   h%(t,i+w2)=b+(rnd(1)-d)*br
  38. 490 :  b=(h%(128-t-i,i)+h%(128-t-i-w,i+w))/2
  39. 500 :   h%(128-t-i-w2,i+w2)=b+(rnd(1)-d)*br
  40. 510 : next i
  41. 520 :next t
  42. 530 w=w/2
  43. 540 next m
  44. 650 :
  45. 660 :
  46. 670 rem ****************************
  47. 680 rem *     berge zeichnen       *
  48. 690 rem ****************************
  49. 700 :
  50. 710 for t=0 to 127 step w
  51. 720 :a=t/2:b=a+w:c=(t+w)/2:f=c+w
  52. 730 :ya=(t+w)+u-h
  53. 740 :yb=t+u-h
  54. 750 :for i=0 to 127-t step w
  55. 760 : ii=127-t-w
  56. 770 : h1=h%(i,t)/5:if h1<n then h1=n
  57. 780 : h2=h%(i,t+w)/5:if h2<n then h2=n
  58. 790 : h3=h%(i+w,t)/5:if h3<n then h3=n
  59. 800 : h4=h%(i+w,t+w)/5:if h4<n then h4=n
  60. 810 : x1=(i+a)*ge+r:y1=yb-h1
  61. 820 : x2=(i+c)*ge+r:y2=ya-h2
  62. 830 : x3=(i+b)*ge+r:y3=yb-h3
  63. 840 : x4=(i+f)*ge+r:y4=ya-h4
  64. 850 : sys 50185,x1,y1,x3,y3,1
  65. 860 : sys 50185,x2,y2,x1,y1,1
  66. 870 : sys 50185,x2,y2,x3,y3,1
  67. 880 : if i>ii goto 910
  68. 890 : sys 50185,x3,y3,x4,y4,1
  69. 900 : sys 50185,x4,y4,x2,y2,1
  70. 910 :next i
  71. 920 next t
  72. 1000 get a$:if a$="" goto 1000
  73. 1010 sys 50179,0:if a$<>"s" then goto 80:rem neustart
  74. 1040 :
  75. 1050 :
  76. 1060 rem ***************************
  77. 1070 rem *   'grafik speichern'    *
  78. 1080 rem ***************************
  79. 1090 :
  80. 1100 input "grafik-name ";n$
  81. 1110 open 2,8,2,"pi."+n$+",p,w":sys 50191:close 2
  82. 1120 goto 80:rem neustart
  83.