home *** CD-ROM | disk | FTP | other *** search
/ Input 64 / Input_64_86-01_1986_Verlag_Heinz_Weise_de.d64 / wurfsimulator (.txt) < prev   
Commodore BASIC  |  2023-02-26  |  7KB  |  108 lines

  1. 900 rem  mp $1900-$237f                          input 64/joerg huth
  2. 999 poke50257,16
  3. 2000 deffnx(t)=v0*cos(a)*t
  4. 2001 deffny(t)=-g/2*t*t+v0*sin(a)*t+y0
  5. 2002 deffnt(t)=v0*sin(a)/g+sqr((v0*sin(a)/g)^2+2*y0/g)
  6. 2003 deffnm(t)=v0*cos(a)*tf
  7. 2004 deffnn(t)=(v0*sin(a))^2/g/2+y0
  8. 2005 poke53280,5:poke53281,15:print"[147]"chr$(14):g=9.81:v0=4:k=(NULL)/180:a=45*k
  9. 2010 tf=fnt(t):xk=1.8:yk=.94
  10. 2015 sy=985248
  11. 2020 poke839,1
  12. 2500 poke53280,5:poke53281,15:print"[147]"chr$(14)
  13. 2510 sys6430:gosub40000:dn$="0123456789+-.e"
  14. 3000 rem modus : eingabe (f1)
  15. 3003 poke832,1:poke53269,3
  16. 3005 print"[147] f1:[197]ingabe  f3:[194]erechnung  f5:[198]lugbahn"
  17. 3007 print"----------------------------------------";
  18. 3010 print"1:[215]inkel 2:[199]esch. 3:[200]oehe 4:[203]oord. 5:[195][204][211]";
  19. 3009 print"----------------------------------------[145]";
  20. 3015 poke198,0
  21. 3020 geta$:ifa$>"0"anda$<"6"then3040
  22. 3030 ifa$="[134]"then4000
  23. 3035 ifa$="[135]"then5000
  24. 3037 goto3020
  25. 3040 onasc(a$)-49goto3200,3300,3400,3500
  26. 3100 rem eingabe des winkels (modus f1)
  27. 3105 print"[147]  [197]ingabe des [193]bschusswinkels ([193]lpha)"
  28. 3110 print"---------------------------------------- [193]lter [215]ert:";a/k
  29. 3120 sys8320,3,0," [193]lpha=?             ":sys8352,3,9,11,dn$,x$:x=val(x$)
  30. 3130 print"[145]";:ifx<0orx>90then3105
  31. 3140 a=x*k:gosub40020:goto3005
  32. 3200 rem eingabe der                         abschussgeschwindigkeit (modus f1)
  33. 3205 print"[147][197]ingabe der [193]bschussgeschwindigkeit (v0)";
  34. 3210 print"---------------------------------------- [193]lter [215]ert:";v0
  35. 3220 sys8320,3,0," v0=?              ":sys8352,3,6,11,dn$,x$:x=val(x$)
  36. 3230 print"[145]";:ifx<=0then3205
  37. 3240 v0=x:goto3005
  38. 3300 rem eingabe der abschusshoehe y(0)          (modus f1)
  39. 3303 a$=str$(y0)
  40. 3305 print"[147]   [197]ingabe der [193]bschusshoehe ( y(0) )"
  41. 3310 print"----------------------------------------[193]lt:";a$;
  42. 3320 printtab(60)"max:"str$(yk*144/165)
  43. 3325 sys8320,3,0,"y(0)=?              ":sys8352,3,7,11,dn$,x$:x=val(x$)
  44. 3330 print"[145]";:ifx>=0andx<=yk*144/165theny0=x:gosub40030:goto3005
  45. 3335 goto3305
  46. 3400 rem eingabe des koodinatensystemes          xk yk  (modus f1)
  47. 3405 print"[147][197]ingabe des [203]oordinatensystems (x-[193]chse)";
  48. 3407 tf=fnt(t):m=fnm(tf):n=fnn(t):x=1.1*m:ifm*164/317<nthenx=1.1*n*317/164
  49. 3410 print"---------------------------------------- y= 0.5*x "
  50. 3413 ifx<=0thenx=1.0e-30
  51. 3414 kj=10^int(log(x)/log(10)):x=int(x/kj*10+.99999999)*kj/10
  52. 3415 sys8320,3,0," x=?"x"           ":sys8352,3,5,11,dn$,x$:x=val(x$)
  53. 3420 print"[145]";:ifx<=0then3405
  54. 3430 xk=x:yk=x*164/317
  55. 3432 ifyk>0thenkj=10^int(log(yk)/log(10)):yk=int(yk/kj*10+.99999999)*kj/10
  56. 3435 ify0*165/144>ykthena$="undefiniert":goto3305
  57. 3440 gosub40030:goto3005
  58. 3500 sys6418:goto3005
  59. 4000 rem modus : berechnung (f3)
  60. 4003 poke832,255:poke53269,0:sys6400
  61. 4004 tf=fnt(t)
  62. 4005 print"[147] f1:[197]ingabe  f3:[194]erechnung  f5:[198]lugbahn"
  63. 4007 print"----------------------------------------"
  64. 4008 print"[197]ingaben:"
  65. 4009 print"[163][163][163][163][163][163][163][163][163]"
  66. 4010 print"[216]-[193]chse:        "str$(xk);"m"
  67. 4020 print"[217]-[193]chse:        "str$(yk);"m"
  68. 4030 print"[193]bschusswinkel: "str$(a/k);" [199]rad"
  69. 4040 print"[193]bschussgeschw.:"str$(v0);"m/s"
  70. 4050 print"[193]bschusshoehe:  "str$(y0);"m"
  71. 4060 print"----------------------------------------[197]rgebnisse:"
  72. 4065 print"[163][163][163][163][163][163][163][163][163][163][163][163][163]"
  73. 4070 print"[205]ax. [198]lughoehe: "str$(fnn(t));"m"
  74. 4075 uf=fnt(t)
  75. 4080 print"[198]lugweite:      "str$(fnm(tf));"m"
  76. 4090 print"[198]lugzeit:       "str$(tf);"s"
  77. 4100 print"- - - - - - - - - - - - - - - - - - - -"
  78. 4110 print"x(t)="v0*cos(a)"[157]*t"
  79. 4120 print"y(t)=";-g/2"[157]*t^2+";v0*sin(a);"[157]*t+"y0
  80. 4125 print"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]   (c) 1986 by [201][206][208][213][212] 64 (";
  81. 4126 print"[202]oerg [200]uth)"
  82. 4130 geta$:ifa$="[133]"then3000
  83. 4140 ifa$="[135]"then5000
  84. 4150 goto4130
  85. 5000 rem modus : flugbahn (f5)
  86. 5003 poke832,1:poke53269,3
  87. 5005 print"[147] f1:[197]ingabe  f3:[194]erechnung  f5:[198]lugbahn"
  88. 5007 print"----------------------------------------";
  89. 5010 ifpeek(839)=0thenprint"@:[197]chtzeit +/-:vor/zurueck *:[196]raw on/off";:goto5017
  90. 5015 print"@:[197]chtzeit +/-:vor/zurueck *:[196]raw on/off";
  91. 5017 print"          [197]inen [205]oment bitte ![145][145][145]":print
  92. 5030 tf=fnt(t):m=fnm(tf):ifm>xkthenx=1.1*158:t=1.1*xk*tf/m:goto5040
  93. 5035 x=m/xk*158:t=tf
  94. 5040 poke842,x:poke841,(x-peek(842))*256:s=sy*t/511
  95. 5050 ifs>4.294967e9thens=256^4-1
  96. 5060 p=256^4:forx=0to3:p=p/256:poke846-x,s/p:s=s-peek(846-x)*p:next
  97. 5200 ab=y0*164/yk:t0=v0*sin(a)*164*t/yk/511:t1=-g*164*t*t/2/yk/511/511
  98. 5220 poke847,ab+1:sys6427,t0,t1
  99. 6990 print"                                      [145][145]"
  100. 6995 print"x:"str$(xk)"m"tab(20)"y:"str$(yk)"m";
  101. 7000 poke198,0:sys6424:ifpeek(840)=1then3000
  102. 7010 goto4000
  103. 9999 end
  104. 40000 poke828,111:sys6406:sys6412:gosub40020:poke837,226-(y0/yk*163)
  105. 40010 sys6421:return
  106. 40020 poke835,a*60/(NULL):sys6415:return
  107. 40030 poke837,226-(y0/yk*163):sys6421:return
  108.