-
-
Notifications
You must be signed in to change notification settings - Fork 556
Make queen-attack clearer for non-chess players #1965
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,17 +9,41 @@ A chessboard can be represented by an 8 by 8 array. | |
So if you are told the white queen is at `c5` (zero-indexed at column 2, row 3) and the black queen at `f2` (zero-indexed at column 5, row 6), then you know that the set-up is like so: | ||
|
||
```text | ||
a b c d e f g h | ||
8 _ _ _ _ _ _ _ _ 8 | ||
7 _ _ _ _ _ _ _ _ 7 | ||
6 _ _ _ _ _ _ _ _ 6 | ||
5 _ _ W _ _ _ _ _ 5 | ||
4 _ _ _ _ _ _ _ _ 4 | ||
3 _ _ _ _ _ _ _ _ 3 | ||
2 _ _ _ _ _ B _ _ 2 | ||
1 _ _ _ _ _ _ _ _ 1 | ||
a b c d e f g h | ||
a b c d e f g h a b c d e f g h a b c d e f g h | ||
8 _ _ _ _ _ _ _ _ 8 8 _ _ _ _ _ _ _ _ 1 8 _ _ _ _ _ _ _ _ 8 | ||
7 _ _ _ _ _ _ _ _ 7 7 _ _ _ _ _ _ _ _ 2 7 _ _ _ W _ _ _ _ 7 | ||
6 _ _ _ W _ _ _ _ 6 6 _ B _ _ _ W _ _ 3 6 _ _ _ _ _ _ _ _ 6 | ||
5 _ _ _ _ _ _ _ _ 5 5 _ _ _ _ _ _ _ _ 4 5 _ _ _ _ _ _ _ _ 5 | ||
4 _ _ _ _ _ _ _ _ 4 4 _ _ _ _ _ _ _ _ 5 4 _ _ _ _ _ _ _ _ 4 | ||
3 _ _ _ _ _ _ B _ 3 3 _ _ _ _ _ _ _ _ 6 3 _ _ _ _ _ _ _ _ 3 | ||
2 _ _ _ _ _ _ _ _ 2 2 _ _ _ _ _ _ _ _ 7 2 _ _ _ B _ _ _ _ 2 | ||
1 _ _ _ _ _ _ _ _ 1 1 _ _ _ _ _ _ _ _ 8 1 _ _ _ _ _ _ _ _ 1 | ||
a b c d e f g h a b c d e f g h a b c d e f g h | ||
``` | ||
``` | ||
|
||
You are also be able to answer whether the queens can attack each other. | ||
In this case, that answer would be yes, they can, because both pieces share a diagonal. | ||
In this case, that answer would be yes; they can, because both pieces share a diagonal, row, or column. | ||
|
||
|
||
### Examples of queens not interacting: | ||
|
||
```text | ||
a b c d e f g h a b c d e f g h a b c d e f g h | ||
8 _ _ _ _ _ _ _ _ 8 8 _ _ _ _ _ _ _ _ 8 8 _ _ _ _ _ _ _ _ 8 | ||
7 _ _ _ _ _ _ _ _ 7 7 _ _ _ _ _ _ _ _ 7 7 _ _ _ W _ _ _ _ 7 | ||
6 _ _ _ _ _ _ _ _ 6 6 _ _ _ _ _ W _ _ 6 6 _ _ _ _ _ _ _ _ 6 | ||
5 _ _ _ _ _ _ _ _ 5 5 _ _ _ _ _ _ _ _ 5 5 _ _ _ _ _ _ _ _ 5 | ||
4 _ _ _ _ W _ _ _ 4 4 _ _ _ _ _ _ _ _ 4 4 _ _ _ _ _ _ _ _ 4 | ||
3 _ _ _ _ _ _ B _ 3 3 _ _ _ _ _ _ _ _ 3 3 _ _ _ _ _ _ _ _ 3 | ||
2 _ _ _ _ _ _ _ _ 2 2 _ _ B _ _ _ _ _ 2 2 _ _ _ _ _ _ B _ 2 | ||
1 _ _ _ _ _ _ _ _ 1 1 _ _ _ _ _ _ _ _ 1 1 _ _ _ _ _ _ _ _ 1 | ||
a b c d e f g h a b c d e f g h a b c d e f g h | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could use an explanation of what you're seeing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, we could use |
||
|
||
In all of these examples, we can see that the queens are not on the same diagonal, row, or column, so they cannot see each other. | ||
|
||
~~~~exercism/note | ||
B and W are the queens, standing for Black and White. | ||
This is not relevant info to the puzzle. | ||
~~~~ |
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.
@T-O-R-U-S You have modified the first example of queens attacking so that it no longer matches the text before it. Not only the positions are different than in the text (the example shows d6 and g3, not c5 and f2 as the text says), but the text is clearly written for a single example, not for 3. Maybe we can just revert this part to the original and only leave the three new examples of queens not attacking?
Additionally, the CI is complaining about linting problems. Those need to be fixed before we can approve the PR.