Skip to content

Instantly share code, notes, and snippets.

@jasondown
Last active March 12, 2019 20:07
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/f53bec90461414929d24662409e70ef3 to your computer and use it in GitHub Desktop.
Save jasondown/f53bec90461414929d24662409e70ef3 to your computer and use it in GitHub Desktop.
// <--- 2nd parameter was (sample : SampleData)
let canMakeSample (robot : Robot) (sample : DiagnosedSampleData) =
sample.Molecules.Counts
|> Map.forall (fun mt count -> robot.Molecules.Counts.[mt] >= count)
// <--- 2nd parameter was (sample : SampleData)
let getRequiredMolecule (robot : Robot) (sample : DiagnosedSampleData) =
let ms =
sample.Molecules.Counts
|> Map.filter (fun mt count -> robot.Molecules.Counts.[mt] < count)
|> Seq.head
ms.Key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment