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
// Project Euler #80. | |
let DECIMAL_DIGITS = 100; | |
// Return square root of x as a big rational, with digits of accuracy | |
let sr x digits = | |
let mutable mean = x/2N; | |
let limit = pown (10N/1N) digits; |
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
// Project Euler #81 - Shortest Path in F# | |
// Doesn't seem very functional, but my first shot at it. | |
// Using Dijkstra's algorithm from wikipedia. | |
let matrix = | |
File.ReadAllLines(@"Matrix.txt") |> Array.map( fun line -> line.Split(",".ToCharArray()) |> Array.map( Int32.Parse)); | |