-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Exercise]: Killer Sudoku Helper #284
[New Exercise]: Killer Sudoku Helper #284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tiny nits
|
||
Throw "Please implement this function" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few trailing new lines, it is a tiny bit but it is an easy fix
$got = Invoke-KillerSudokuHelper -Sum 7 -Size 3 -Exclude @() | ||
$want = @( ,@(1, 2, 4)) | ||
|
||
,$got | Should -BeExactly $want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this, ,
is intended to be here.
|
||
It "Cage with only 1 possible combination" { | ||
$got = Invoke-KillerSudokuHelper -Sum 7 -Size 3 -Exclude @() | ||
$want = @( ,@(1, 2, 4)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is sorta ugly having the ,
before the array, when I removed the ,
mentioned in the comment above, it does work to remove that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the "," indeed the test still work. My reason for it was how powershell unroll their array depending on context.
$want = @( @(1, 2, 4))
$want.Count will be equal 3.
However $want = @( ,@(1, 2, 4))
$want.Count will be equal 1.
Technically speaking, want count should only be 1, because there is only one possible way to fill out the cells.
For this problem, it probably doesnt matter regardless when the array solution only consist of one solution of inner array.
But I think there should be an exercise to teach students about this behavior later
-Fix some blank lines and update test file
No description provided.