Skip to content

Instantly share code, notes, and snippets.

@jasondown
Created December 30, 2018 16:12
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 jasondown/67a7cfc006f916a402253f5abc6b55f6 to your computer and use it in GitHub Desktop.
Save jasondown/67a7cfc006f916a402253f5abc6b55f6 to your computer and use it in GitHub Desktop.
// GameState -> String
let getMove (gs : GameState) =
let me = gs.Robots |> List.find (fun r -> r.Player = Player.Me)
let mySamples = gs.Samples |> List.filter (fun s -> s.CarriedBy = Player.Me)
let samplesReady = mySamples |> List.filter (canMakeSample me)
let cloudSamples =
gs.Samples
|> List.filter (fun s -> s.CarriedBy = Player.Cloud)
|> List.sortByDescending (fun s -> s.HealthPoints)
// more to come
""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment