Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replace == with =:=, due to coaxing from Kostis Sagonas

  • Loading branch information...
commit faa8a31ff9e3974deae960a61062f68a9e4e24c4 1 parent 9c69a9d
@apauley authored
Showing with 7 additions and 7 deletions.
  1. +2 −2 sudoku.erl
  2. +5 −5 unittests.erl
View
4 sudoku.erl
@@ -189,8 +189,8 @@ is_solved(Puzzle) ->
all(fun(Unit) -> is_unit_solved(Puzzle, Unit) end, unitlist()).
is_unit_solved(Puzzle, Unit) ->
UnitValues = flatmap(fun(S) -> values(Puzzle, S) end, Unit),
- (length(UnitValues) == 9)
- and (lists:usort(UnitValues) == ?digits).
+ (length(UnitValues) =:= 9)
+ and (lists:usort(UnitValues) =:= ?digits).
to_string(Puzzle) ->
{ValuesDict, _} = Puzzle,
View
10 unittests.erl
@@ -45,11 +45,11 @@ test_units() ->
[[a2,b2,c2,d2,e2,f2,g2,h2,i2]|_] = units(c2),
%% Each square should have exactly 3 units
- true = all(fun(Units) -> length(Units) == 3 end,
+ true = all(fun(Units) -> length(Units) =:= 3 end,
[units(Square) || Square <- squares()]),
%% Each unit should contain exactly nine squares
- TruthValues = [all(fun(Unit) -> length(Unit) == 9 end,
+ TruthValues = [all(fun(Unit) -> length(Unit) =:= 9 end,
units(Square)) || Square <- squares()],
%% Each square should be part of all its units
@@ -67,7 +67,7 @@ test_peers() ->
Peers = sort(peers(c2)),
%% Each square should have exactly 20 squares as its peers
- true = all(fun(Units) -> length(Units) == 20 end,
+ true = all(fun(Units) -> length(Units) =:= 20 end,
[peers(Square) || Square <- squares()]),
ok.
@@ -80,7 +80,7 @@ test_empty_puzzle() ->
%% The values of all keys should start with all possible values.
Squares = squares(),
Digits = "123456789",
- true = all(fun(Values) -> Values == Digits end,
+ true = all(fun(Values) -> Values =:= Digits end,
[values(Puzzle, Square) || Square <- Squares]),
ok.
@@ -225,7 +225,7 @@ is_sudoku_puzzle(Puzzle) ->
is_sudoku_dict(ValuesDict).
is_sudoku_dict(ValuesDict) ->
- lists:sort(dict:fetch_keys(ValuesDict)) == squares().
+ lists:sort(dict:fetch_keys(ValuesDict)) =:= squares().
solved_puzzle() ->
GridString = "41736982563215894795872431682543
Please sign in to comment.
Something went wrong with that request. Please try again.