Created
January 23, 2018 13:56
-
-
Save scoiatael/994b673c77f2c12662dba19415cbb9e2 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 exchange (a : int, b : int) : Move = | |
let toKV arr = Map.ofArray (Array.indexed arr) in | |
let ofKV map = Array.map snd (Array.sortBy fst (Map.toArray map)) in | |
fun circle -> | |
ofKV (Map.add b circle.[a] (Map.add a circle.[b] (toKV circle))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment