ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
1.1 KiB

  1. 10 REM ROCKET.BAS by Brian Tung
  2. 20 REM
  3. 30 DEFDBL A-Z
  4. 40 A=1.032: REM Earth gravity in light-years per year squared
  5. 50 INPUT "Distance in light-years (0-100 million)"; D
  6. 60 IF D>=0 AND D<=100000000 THEN 80
  7. 70 PRINT "Distance must be between 0 and 100 million l-y": GOTO 50
  8. 80 D1=D/2
  9. 90 T=SQR(D1*D1+(2*D1/A))
  10. 100 X=A*T
  11. 110 M=1: REM Lines 110-180 compute inverse sinh
  12. 120 IF X<0 THEN M=-1
  13. 130 S=LOG(ABS(X)+1)
  14. 140 S1=S+1
  15. 150 X1=(EXP(S)-EXP(-S))/2-ABS(X)
  16. 160 S1=X1/(EXP(S)+EXP(-S))/2
  17. 170 S=S-S1
  18. 180 IF ABS(S1)>.0000001 THEN 150
  19. 190 T1=1/A*S*M
  20. 200 V=A*T/SQR(1+(A*T)*(A*T))
  21. 210 PRINT USING "Time on Earth: #########.### years"; 2*T
  22. 220 PRINT USING "Time on board: #########.### years"; 2*T1
  23. 230 Z$ = "Top speed: #.###"
  24. 240 IF D<1 THEN 280
  25. 250 Z1=INT(2*LOG(D)/LOG(10))
  26. 260 IF D>=1 AND D<10000000 THEN Z$=Z$+STRING$(Z1,"#")
  27. 270 IF D>=10000000 THEN Z$=Z$+"#############"
  28. 280 Z$=Z$+" c"
  29. 290 PRINT USING Z$; V
  30. 300 END
  31. 900 REM ---------------------------
  32. 910 REM APPEARED IN COMPUTERS IN
  33. 920 REM ASTRONOMY, SKY & TELESCOPE,
  34. 930 REM FEBRUARY 2002, PAGE 66
  35. 940 REM ---------------------------