home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.fortran      Putting John Backus on a giant pedestal      5,127 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,673 of 5,127   
   Lawrence D'Oliveiro to All   
   Vintage Lunar Lander Game (2/2)   
   22 Jun 24 08:37:00   
   
   [continued from previous message]   
      
               if (time_subinterval .lt. 0.005) then   
                   endgame = .true.   
                   exit   
               end if   
               time_subinterval = &   
                       2 &   
                   * &   
                       altitude &   
                   / &   
                       ( &   
                           velocity &   
                       + &   
                           sqrt &   
                             ( &   
                                   velocity * velocity &   
                               + &   
                                   2 * altitude * (G - Z * fuel_rate /   
   mass_total) &   
                             ) &   
                       )   
               call delta   
               call update   
           end do   
       end subroutine   
      
       subroutine going_back_up   
           ! handles situation where spacecraft is reversing direction   
           ! from descent to ascent, checking in case it is going to hit   
           ! the ground.   
           real(kind = useprec) :: W   
           do   
               W = (1 - mass_total * G / (Z * fuel_rate)) / 2   
               time_subinterval = &   
                           mass_total &   
                       * &   
                           velocity &   
                       / &   
                           (Z * fuel_rate * (W + sqrt(W * W + velocity / Z))) &   
                   + &   
                       0.05   
               call delta   
               if (next_altitude .le. 0) then   
                   call down_to_the_ground   
                   exit   
               end if   
               call update   
               if (next_velocity .ge. 0 .or. velocity .le. 0) &   
                   exit ! no danger of landing/impact   
           end do   
       end subroutine   
      
       subroutine final_status   
           real(kind = useprec) :: W   
      
           if (out_of_fuel) then   
               print "('FUEL OUT AT ', F9.2, ' SECS')", elapsed   
               time_subinterval = (sqrt(velocity * velocity + 2 * altitude * G) -   
   velocity) / G   
               velocity = velocity + G * time_subinterval   
               elapsed = elapsed + time_subinterval   
           end if   
           print "('ON THE MOON AT ', F9.2, ' SECS')", elapsed   
           W = 3600 * velocity   
           print "('IMPACT VELOCITY OF ', F9.2, ' M.P.H')", W   
           print "('FUEL LEFT: ', F15.2, ' LBS')", mass_total - mass_empty   
           if (W .gt. 1) then   
               if (W .gt. 10) then   
                   if (W .gt. 22) then   
                       if (W .gt. 40) then   
                           if (W .gt. 60) then   
                               print "(A)", "SORRY,BUT THERE WERE NO   
   SURVIVORS-YOU BLEW IT!"   
                               print "('IN FACT YOU BLASTED A NEW LUNAR CRATER ',   
   F9.2, ' FT. DEEP')", &   
                                   W * 0.277777   
                           else   
                               print "(A)", "CRASH LANDING-YOU'VE 5 HRS OXYGEN"   
                           end if   
                       else   
                           print "(A)", "CRAFT DAMAGE. GOOD LUCK"   
                       end if   
                   else   
                       print "(A)", "CONGRATULATIONS ON A POOR LANDING"   
                   end if   
               else   
                   print "(A)", "GOOD LANDING-(COULD BE BETTER)"   
               end if   
           else   
               print "(A)", "PERFECT LANDING !-(LUCKY)"   
           end if   
       end subroutine   
      
   end program   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca