Skip to content
Browse files

The default seperator in puzzle files is a newline, no need to specify

it explicitly.
  • Loading branch information...
1 parent b7ce2ab commit 03b79df150bd50aa9138711a88469c5db53998ef @apauley committed
Showing with 7 additions and 5 deletions.
  1. +5 −5 sudoku
  2. +2 −0 sudoku.erl
View
10 sudoku
@@ -1,5 +1,5 @@
#!/usr/bin/env escript
--import(sudoku, [print_results/2]).
+-import(sudoku, [print_results/1]).
main(Args) ->
{ok, sudoku} = compile:file(sudoku, [native]),
@@ -13,8 +13,8 @@ run_solver(["runtests"]) ->
ok = unittests:test(),
io:format("All tests passed :-)~n");
run_solver(["solve"]) ->
- print_results("easy50.txt", "\n"),
- print_results("top95.txt", "\n"),
- print_results("hardest.txt", "\n");
+ print_results("easy50.txt"),
+ print_results("top95.txt"),
+ print_results("hardest.txt");
run_solver(["solve", Filename]) ->
- print_results(Filename, "\n").
+ print_results(Filename).
View
2 sudoku.erl
@@ -228,6 +228,8 @@ solve_file(Filename, Seperator) ->
ok = to_file(OutFilename, Solutions),
Solutions.
+print_results(Filename) ->
+ print_results(Filename, "\n").
print_results(Filename, Seperator) ->
{Time, Solutions} = timer:tc(sudoku, solve_file, [Filename, Seperator]),
Solved = filter(fun(Puzzle) -> is_solved(Puzzle) end, Solutions),

0 comments on commit 03b79df

Please sign in to comment.
Something went wrong with that request. Please try again.