Skip to content

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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 35 additions & 11 deletions exercises/queen-attack/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +12 to +21
Copy link
Member

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.

```
```

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
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use an explanation of what you're seeing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, we could use Q for both, since it is explained that the side does not matter, the black nor the white makes a difference.


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.
~~~~