1
module SudokuSolver.Main
3 module Solver = Version1
9 printfn
"Usage: %s <suduko file>" System.AppDomain.CurrentDomain.FriendlyName
13 if args
.Length = 0 then
16 elif
Array.exists
(fun arg
-> arg
= "-h" || arg = "--help") args
then
20 for filepath
in args
do
21 use fs = new FileStream(filepath
, FileMode.Open, FileAccess.Read)
22 use sr = new StreamReader(fs)
25 while sr.Peek() <> -1 do
26 let b = Solver.Board sr
27 b.Show System.Console.Out
31 let timer = System.Diagnostics.Stopwatch()
35 then b.Show System.Console.Out
36 else printfn "No solution"
39 printfn "Time: %A ms" timer.ElapsedMilliseconds