Skip to content

Instantly share code, notes, and snippets.

@yuhr
Created September 28, 2019 06:54
Show Gist options
  • Save yuhr/118258f55120653984a082f397afe50c to your computer and use it in GitHub Desktop.
Save yuhr/118258f55120653984a082f397afe50c to your computer and use it in GitHub Desktop.
let possibilityOfThreshold t =
let a = floor (double t /10.0) |> int
let b = t - a*10 |> int
let s = 1 + sign (b-a)
let ss = sign s
(20-s-a)*a + s*b + ss
for i in [0..100] do
printfn "%d : %d" i (possibilityOfThreshold i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment