Last active
December 30, 2018 17:08
-
-
Save jasondown/2caf0580fcd14251b28de3cb2bc7d419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
match mySamples.Length, samplesReady.Length, cloudSamples.Length, me.Location with | |
| _, sr, _, Module.Laboratory when sr > 0 -> | |
produce samplesReady.Head | |
| _, sr, _, _ when sr > 0 -> | |
goto Module.Laboratory | |
| ms, _, cs, Module.Diagnosis when ms = 0 && cs > 0 -> | |
collect cloudSamples.Head | |
| ms, _, cs, _ when ms = 0 && cs > 0 -> | |
goto Module.Diagnosis | |
| _, _, _, Module.Molecules -> | |
gather (getRequiredMolecule me mySamples.Head) | |
| _, _, _, _ -> | |
goto Module.Molecules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment