
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.51 KB | hits: 8 | expires: Never
module Tools
open System
let sqr x = float(x * x) (* Square two ints into a float *)
(* Remove element where predicate *)
let rec remove l predicate =
match l with
| [] -> []
| hd::tl -> if predicate(hd) then
(remove tl predicate)
else
hd::(remove tl predicate)
let loadMap path =
IO.File.ReadAllText(path).Split(';')
|> Array.filter(fun s -> s<> String.Empty)
|> Array.map(fun s-> Int32.Parse(s.Replace(";",String.Empty)))