exercism / typescript

Exercism exercises in TypeScript.
https://exercism.org/tracks/typescript
MIT License
148 stars 160 forks source link

Refine Queen Attack #1410

Closed MissingHandle closed 11 months ago

MissingHandle commented 11 months ago

When a chess board is printed, it is generally done so from white's perspective: with white at the bottom of the board, and black at the top. The bottom-left square in chess notation is a1.

When using 0-indexed arrays, as this practice exercise does, one would naturally think that [0,0] might correspond to square a1.

Instead, prior to this change, the tests specified that the first square printed was [0,0], which would make [0,0] equivalent to a8.

If a solution did treat [0,0] as a1, then they would run into problems at the board visualization stage.

In this PR, we add tests that explicitly clarify the white and black queen's starting positions such that they correspond with an orientation of [0,0] being equivalent to square a1. We also update the board visualization tests accordingly.

github-actions[bot] commented 11 months ago

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.