diff --git a/exercises/practice/killer-sudoku-helper/.meta/Example.fs b/exercises/practice/killer-sudoku-helper/.meta/Example.fs index b4caf1f3a..31b9f5d73 100644 --- a/exercises/practice/killer-sudoku-helper/.meta/Example.fs +++ b/exercises/practice/killer-sudoku-helper/.meta/Example.fs @@ -9,7 +9,7 @@ module List = List.map ((@) [ x ]) (combinations (k - 1) xs) @ combinations k xs -let combinations sum size exclude = +let combinations exclude size sum = [ 1..9 ] |> List.except exclude |> List.combinations size diff --git a/exercises/practice/killer-sudoku-helper/KillerSudokuHelper.fs b/exercises/practice/killer-sudoku-helper/KillerSudokuHelper.fs index da79e195f..7cee9a096 100644 --- a/exercises/practice/killer-sudoku-helper/KillerSudokuHelper.fs +++ b/exercises/practice/killer-sudoku-helper/KillerSudokuHelper.fs @@ -1,4 +1,4 @@ module KillerSudokuHelper -let combinations sum size exclude = +let combinations exclude size sum = failwith "Please implement the 'combinations' function" diff --git a/exercises/practice/killer-sudoku-helper/KillerSudokuHelperTests.fs b/exercises/practice/killer-sudoku-helper/KillerSudokuHelperTests.fs index 33727c111..a59009d0c 100644 --- a/exercises/practice/killer-sudoku-helper/KillerSudokuHelperTests.fs +++ b/exercises/practice/killer-sudoku-helper/KillerSudokuHelperTests.fs @@ -7,61 +7,53 @@ open KillerSudokuHelper [] let ``1`` () = - combinations 1 1 [] |> should equal [ [ 1 ] ] + combinations [] 1 1 |> should equal [[1]] [] let ``2`` () = - combinations 2 1 [] |> should equal [ [ 2 ] ] + combinations [] 1 2 |> should equal [[2]] [] let ``3`` () = - combinations 3 1 [] |> should equal [ [ 3 ] ] + combinations [] 1 3 |> should equal [[3]] [] let ``4`` () = - combinations 4 1 [] |> should equal [ [ 4 ] ] + combinations [] 1 4 |> should equal [[4]] [] let ``5`` () = - combinations 5 1 [] |> should equal [ [ 5 ] ] + combinations [] 1 5 |> should equal [[5]] [] let ``6`` () = - combinations 6 1 [] |> should equal [ [ 6 ] ] + combinations [] 1 6 |> should equal [[6]] [] let ``7`` () = - combinations 7 1 [] |> should equal [ [ 7 ] ] + combinations [] 1 7 |> should equal [[7]] [] let ``8`` () = - combinations 8 1 [] |> should equal [ [ 8 ] ] + combinations [] 1 8 |> should equal [[8]] [] let ``9`` () = - combinations 9 1 [] |> should equal [ [ 9 ] ] + combinations [] 1 9 |> should equal [[9]] [] let ``Cage with sum 45 contains all digits 1:9`` () = - combinations 45 9 [] - |> should equal [ [ 1; 2; 3; 4; 5; 6; 7; 8; 9 ] ] + combinations [] 9 45 |> should equal [[1; 2; 3; 4; 5; 6; 7; 8; 9]] [] let ``Cage with only 1 possible combination`` () = - combinations 7 3 [] - |> should equal [ [ 1; 2; 4 ] ] + combinations [] 3 7 |> should equal [[1; 2; 4]] [] let ``Cage with several combinations`` () = - combinations 10 2 [] - |> should - equal - [ [ 1; 9 ] - [ 2; 8 ] - [ 3; 7 ] - [ 4; 6 ] ] + combinations [] 2 10 |> should equal [[1; 9]; [2; 8]; [3; 7]; [4; 6]] [] let ``Cage with several combinations that is restricted`` () = - combinations 10 2 [ 1; 4 ] - |> should equal [ [ 2; 8 ]; [ 3; 7 ] ] + combinations [1; 4] 2 10 |> should equal [[2; 8]; [3; 7]] + diff --git a/generators/Generators.fs b/generators/Generators.fs index df181d71a..3c3d9b005 100644 --- a/generators/Generators.fs +++ b/generators/Generators.fs @@ -2074,6 +2074,8 @@ type ResistorColorTrio() = type KillerSudokuHelper() = inherit ExerciseGenerator() + + override _.MapTestCase testCase = { testCase with Input = testCase.Input.["cage"].ToObject>() } type StateOfTicTacToe() = inherit ExerciseGenerator()