Skip to content

Instantly share code, notes, and snippets.

@monkieboy
Created June 23, 2016 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monkieboy/70713086b67d3fece44fa10d6b26cabb to your computer and use it in GitHub Desktop.
Save monkieboy/70713086b67d3fece44fa10d6b26cabb to your computer and use it in GitHub Desktop.
module ProgNet.Program
open System
open ProgNet.ClimbHill
[<EntryPoint>]
let main argv =
let printTitle title =
printfn ""
printfn ""
printfn "%s" title
printfn "%s" (String('=', title.Length))
printfn ""
printTitle "Estimating Battery Life"
let bestLine = BatteryLife.findBestLine Fuel.Readings
let totalMinutes = bestLine.InitialFuel / (- bestLine.Slope)
let missionStart = DateTime(2016, 6, 1, 0, 0, 0)
let elapsedMinutes = DateTime.Now.Subtract(missionStart).TotalMinutes
let remainingMinutes = totalMinutes - elapsedMinutes
printfn "%s minutes remaining." (remainingMinutes.ToString("n1"))
Console.ReadKey() |> ignore
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment