From d7f8f03911f206680eadf3030ec183be4e89ac66 Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Sat, 23 May 2026 13:47:39 +0100 Subject: [PATCH 1/9] sync problem specifications data and docs with exercise --- .../PalindromeProductsTest.php | 19 +++++---- .../queen-attack/.docs/instructions.md | 36 +++++++---------- .../practice/queen-attack/.meta/tests.toml | 40 ++++++++++++------- 3 files changed, 51 insertions(+), 44 deletions(-) diff --git a/exercises/practice/palindrome-products/PalindromeProductsTest.php b/exercises/practice/palindrome-products/PalindromeProductsTest.php index 88f5bacde..4789ccbab 100644 --- a/exercises/practice/palindrome-products/PalindromeProductsTest.php +++ b/exercises/practice/palindrome-products/PalindromeProductsTest.php @@ -25,7 +25,7 @@ public function testFindsTheSmallestPalindromeFromSingleDigitFactors(): void ]); } - /** + /** * uuid: 0853f82c-5fc4-44ae-be38-fadb2cced92d */ #[TestDox('find the largest palindrome from single digit factors')] @@ -39,7 +39,7 @@ public function testFindsTheLargestPalindromeFromSingleDigitFactors(): void ]); } - /** + /** * uuid: 66c3b496-bdec-4103-9129-3fcb5a9063e1 */ #[TestDox('find the smallest palindrome from double digit factors')] @@ -52,7 +52,7 @@ public function testFindTheSmallestPalindromeFromDoubleDigitFactors(): void ]); } - /** + /** * uuid: a10682ae-530a-4e56-b89d-69664feafe53 */ #[TestDox('find the largest palindrome from double digit factors')] @@ -65,7 +65,7 @@ public function testFindTheLargestPalindromeFromDoubleDigitFactors(): void ]); } - /** + /** * uuid: cecb5a35-46d1-4666-9719-fa2c3af7499d */ #[TestDox('find the smallest palindrome from triple digit factors')] @@ -104,6 +104,8 @@ public function testFindSmallestPalindromeFromFourDigitFactors(): void ]); } + + /** * uuid: 787525e0-a5f9-40f3-8cb2-23b52cf5d0be */ @@ -117,7 +119,8 @@ public function testFindTheLargestPalindromeFromFourDigitFactors(): void ]); } - /** + + /** * uuid: 58fb1d63-fddb-4409-ab84-a7a8e58d9ea0 */ #[TestDox('empty result for smallest if no palindrome in the range')] @@ -128,7 +131,7 @@ public function testEmptyResultForSmallestIfNoPalindromeInTheRange(): void } - /** + /** * uuid: 9de9e9da-f1d9-49a5-8bfc-3d322efbdd02 */ #[TestDox('empty result for largest if no palindrome in the range')] @@ -139,7 +142,7 @@ public function testEmptyResultForLargestIfNoPalindromeInTheRange(): void } - /** + /** * uuid: 12e73aac-d7ee-4877-b8aa-2aa3dcdb9f8a */ #[TestDox('error result for smallest if min is more than max')] @@ -150,7 +153,7 @@ public function testErrorResultForSmallestIfMinIsMoreThanMax(): void } - /** + /** * uuid: eeeb5bff-3f47-4b1e-892f-05829277bd74 */ #[TestDox('error result for largest if min is more than max')] diff --git a/exercises/practice/queen-attack/.docs/instructions.md b/exercises/practice/queen-attack/.docs/instructions.md index 1f8e61a68..97f22a0ae 100644 --- a/exercises/practice/queen-attack/.docs/instructions.md +++ b/exercises/practice/queen-attack/.docs/instructions.md @@ -1,27 +1,21 @@ # Instructions -Given the position of two queens on a chess board, indicate whether or not they -are positioned so that they can attack each other. +Given the position of two queens on a chess board, indicate whether or not they are positioned so that they can attack each other. -In the game of chess, a queen can attack pieces which are on the same -row, column, or diagonal. +In the game of chess, a queen can attack pieces which are on the same row, column, or diagonal. A chessboard can be represented by an 8 by 8 array. -So if you're told the white queen is at (2, 3) and the black queen at -(5, 6), then you'd know you've got a set-up like so: - -```text -_ _ _ _ _ _ _ _ -_ _ _ _ _ _ _ _ -_ _ _ W _ _ _ _ -_ _ _ _ _ _ _ _ -_ _ _ _ _ _ _ _ -_ _ _ _ _ _ B _ -_ _ _ _ _ _ _ _ -_ _ _ _ _ _ _ _ -``` - -You'd 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. +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: + +![A chess board with two queens. Arrows emanating from the queen at c5 indicate possible directions of capture along file, rank and diagonal.](https://assets.exercism.org/images/exercises/queen-attack/queen-capture.svg) + +You are also 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. + +## Credit + +The chessboard image was made by [habere-et-dispertire][habere-et-dispertire] using LaTeX and the [chessboard package][chessboard-package] by Ulrike Fischer. + +[habere-et-dispertire]: https://exercism.org/profiles/habere-et-dispertire +[chessboard-package]: https://github.com/u-fischer/chessboard diff --git a/exercises/practice/queen-attack/.meta/tests.toml b/exercises/practice/queen-attack/.meta/tests.toml index 8a2f794c0..e0624123d 100644 --- a/exercises/practice/queen-attack/.meta/tests.toml +++ b/exercises/practice/queen-attack/.meta/tests.toml @@ -1,39 +1,49 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. [3ac4f735-d36c-44c4-a3e2-316f79704203] -description = "queen with a valid position" +description = "Test creation of Queens with valid and invalid positions -> queen with a valid position" [4e812d5d-b974-4e38-9a6b-8e0492bfa7be] -description = "queen must have positive row" +description = "Test creation of Queens with valid and invalid positions -> queen must have positive row" [f07b7536-b66b-4f08-beb9-4d70d891d5c8] -description = "queen must have row on board" +description = "Test creation of Queens with valid and invalid positions -> queen must have row on board" [15a10794-36d9-4907-ae6b-e5a0d4c54ebe] -description = "queen must have positive column" +description = "Test creation of Queens with valid and invalid positions -> queen must have positive column" [6907762d-0e8a-4c38-87fb-12f2f65f0ce4] -description = "queen must have column on board" +description = "Test creation of Queens with valid and invalid positions -> queen must have column on board" [33ae4113-d237-42ee-bac1-e1e699c0c007] -description = "can not attack" +description = "Test the ability of one queen to attack another -> cannot attack" [eaa65540-ea7c-4152-8c21-003c7a68c914] -description = "can attack on same row" +description = "Test the ability of one queen to attack another -> can attack on same row" [bae6f609-2c0e-4154-af71-af82b7c31cea] -description = "can attack on same column" +description = "Test the ability of one queen to attack another -> can attack on same column" [0e1b4139-b90d-4562-bd58-dfa04f1746c7] -description = "can attack on first diagonal" +description = "Test the ability of one queen to attack another -> can attack on first diagonal" [ff9b7ed4-e4b6-401b-8d16-bc894d6d3dcd] -description = "can attack on second diagonal" +description = "Test the ability of one queen to attack another -> can attack on second diagonal" [0a71e605-6e28-4cc2-aa47-d20a2e71037a] -description = "can attack on third diagonal" +description = "Test the ability of one queen to attack another -> can attack on third diagonal" [0790b588-ae73-4f1f-a968-dd0b34f45f86] -description = "can attack on fourth diagonal" +description = "Test the ability of one queen to attack another -> can attack on fourth diagonal" + +[543f8fd4-2597-4aad-8d77-cbdab63619f8] +description = "Test the ability of one queen to attack another -> cannot attack if falling diagonals are only the same when reflected across the longest falling diagonal" From 9cbb6b6aa240bb0ee48be6e44298b12ea6c87cb8 Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Sat, 23 May 2026 13:49:34 +0100 Subject: [PATCH 2/9] remove strict types comments from test file and example code --- .../practice/queen-attack/.meta/example.php | 22 ------------------- .../practice/queen-attack/QueenAttackTest.php | 21 ------------------ 2 files changed, 43 deletions(-) diff --git a/exercises/practice/queen-attack/.meta/example.php b/exercises/practice/queen-attack/.meta/example.php index bff6c2870..9ebf1680c 100644 --- a/exercises/practice/queen-attack/.meta/example.php +++ b/exercises/practice/queen-attack/.meta/example.php @@ -1,27 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); /** diff --git a/exercises/practice/queen-attack/QueenAttackTest.php b/exercises/practice/queen-attack/QueenAttackTest.php index 9817e3359..89ea48539 100644 --- a/exercises/practice/queen-attack/QueenAttackTest.php +++ b/exercises/practice/queen-attack/QueenAttackTest.php @@ -1,26 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ declare(strict_types=1); From c06346c7808cdd3e60ab6feaeeeb0dfedb2d9b7a Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Sat, 23 May 2026 15:07:28 +0100 Subject: [PATCH 3/9] adjust tests to match canonical data and add missing test --- .../practice/queen-attack/QueenAttackTest.php | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/exercises/practice/queen-attack/QueenAttackTest.php b/exercises/practice/queen-attack/QueenAttackTest.php index 89ea48539..f0348273b 100644 --- a/exercises/practice/queen-attack/QueenAttackTest.php +++ b/exercises/practice/queen-attack/QueenAttackTest.php @@ -4,6 +4,8 @@ declare(strict_types=1); use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\TestDox; + class QueenAttackTest extends TestCase { @@ -12,17 +14,19 @@ public static function setUpBeforeClass(): void require_once 'QueenAttack.php'; } - /** - * Test a queen is placed in a valid position. + /** + * uuid: 3ac4f735-d36c-44c4-a3e2-316f79704203 */ + #[TestDox('Test creation of Queens with valid and invalid positions -> queen with a valid position')] public function testCreateQueenWithValidPosition(): void { $this->assertTrue(placeQueen(2, 2)); } /** - * Test the queen is placed on a positive rank. + * uuid: 4e812d5d-b974-4e38-9a6b-8e0492bfa7be */ + #[TestDox('Test creation of Queens with valid and invalid positions -> queen must have positive row')] public function testQueenHasPositiveRank(): void { $this->expectException(InvalidArgumentException::class); @@ -32,8 +36,9 @@ public function testQueenHasPositiveRank(): void } /** - * Test the queen has a rank on the board. + * uuid: f07b7536-b66b-4f08-beb9-4d70d891d5c8 */ + #[TestDox('Test creation of Queens with valid and invalid positions -> queen must have row on board')] public function testQueenHasRankOnBoard(): void { $this->expectException(InvalidArgumentException::class); @@ -43,8 +48,9 @@ public function testQueenHasRankOnBoard(): void } /** - * Test the queen is placed on a positive file. + * uuid: 15a10794-36d9-4907-ae6b-e5a0d4c54ebe */ + #[TestDox('Test creation of Queens with valid and invalid positions -> queen must have positive column')] public function testQueenHasPositiveFile(): void { $this->expectException(InvalidArgumentException::class); @@ -54,8 +60,9 @@ public function testQueenHasPositiveFile(): void } /** - * Test the queen has a file on the board. + * uuid: 6907762d-0e8a-4c38-87fb-12f2f65f0ce4 */ + #[TestDox('Test creation of Queens with valid and invalid positions -> queen must have column on board')] public function testQueenHasFileOnBoard(): void { $this->expectException(InvalidArgumentException::class); @@ -65,58 +72,75 @@ public function testQueenHasFileOnBoard(): void } /** - * Test if queens can attack each other. + * uuid: 33ae4113-d237-42ee-bac1-e1e699c0c007 */ + #[TestDox('Test the ability of one queen to attack another -> cannot attack')] public function testQueensCanAttack(): void { $this->assertFalse(canAttack([2, 4], [6, 6])); } /** - * Test if queens can attack each other on the same rank. + * uuid: eaa65540-ea7c-4152-8c21-003c7a68c914 */ + #[TestDox('Test the ability of one queen to attack another -> can attack on same row')] public function testQueensCanAttackOnSameRank(): void { $this->assertTrue(canAttack([2, 4], [2, 6])); } /** - * Test if queens can attack each other on the same file. + * uuid: bae6f609-2c0e-4154-af71-af82b7c31cea */ + #[TestDox('Test the ability of one queen to attack another -> can attack on same column')] public function testQueensCanAttackOnSameFile(): void { $this->assertTrue(canAttack([4, 5], [2, 5])); } /** - * Test if queens can attack each other on the first diagonal. + * uuid: 0e1b4139-b90d-4562-bd58-dfa04f1746c7 */ + #[TestDox('Test the ability of one queen to attack another -> can attack on first diagonal')] public function testQueensCanAttackOnFirstDiagonal(): void { $this->assertTrue(canAttack([2, 2], [0, 4])); } /** - * Test if queens can attack each other on the second diagonal. + * uuid: ff9b7ed4-e4b6-401b-8d16-bc894d6d3dcd */ + #[TestDox('Test the ability of one queen to attack another -> can attack on second diagonal')] public function testQueensCanAttackOnSecondDiagonal(): void { $this->assertTrue(canAttack([2, 2], [3, 1])); } /** - * Test if queens can attack each other on the third diagonal. + * uuid: 0a71e605-6e28-4cc2-aa47-d20a2e71037a */ + #[TestDox('Test the ability of one queen to attack another -> can attack on third diagonal')] public function testQueensCanAttackOnThirdDiagonal(): void { $this->assertTrue(canAttack([2, 2], [1, 1])); } /** - * Test if queens can attack each other on the fourth diagonal. + * uuid: 0790b588-ae73-4f1f-a968-dd0b34f45f86 */ + #[TestDox('Test the ability of one queen to attack another -> can attack on fourth diagonal')] public function testQueensCanAttackOnFourthDiagonal(): void { - $this->assertTrue(canAttack([2, 2], [5, 5])); + $this->assertTrue(canAttack([1, 7], [0, 6])); } + + /** + * uuid: 543f8fd4-2597-4aad-8d77-cbdab63619f8 + */ + #[TestDox('Test the ability of one queen to attack another -> cannot attack if falling diagonals are only the same when reflected across the longest falling diagonal')] + public function testQueensCannotAttackReflectedDiagonal(): void + { + $this->assertFalse(canAttack([4, 1], [2, 5])); + } + } From d2b02ec8131e23ff55ee79779504dd2c8acd14ef Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Sat, 23 May 2026 15:10:32 +0100 Subject: [PATCH 4/9] add exercise to auto-sync.txt --- bin/auto-sync.txt | 1 + exercises/practice/queen-attack/.meta/config.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/auto-sync.txt b/bin/auto-sync.txt index b7a2f84ae..e74773c2c 100644 --- a/bin/auto-sync.txt +++ b/bin/auto-sync.txt @@ -61,6 +61,7 @@ phone-number pig-latin protein-translation proverb +queen-attack raindrops reverse-string rna-transcription diff --git a/exercises/practice/queen-attack/.meta/config.json b/exercises/practice/queen-attack/.meta/config.json index 501ad2e40..3db280baa 100644 --- a/exercises/practice/queen-attack/.meta/config.json +++ b/exercises/practice/queen-attack/.meta/config.json @@ -7,7 +7,8 @@ "G-Rath", "kunicmarko20", "kytrinyx", - "petemcfarlane" + "petemcfarlane", + "A-O-Emmanuel" ], "files": { "solution": [ From 50a9dcaaa64a8bd47e98dd522207f0de238fda1f Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Sat, 23 May 2026 15:21:21 +0100 Subject: [PATCH 5/9] fix lint issue --- exercises/practice/queen-attack/QueenAttackTest.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/exercises/practice/queen-attack/QueenAttackTest.php b/exercises/practice/queen-attack/QueenAttackTest.php index f0348273b..2f96062d9 100644 --- a/exercises/practice/queen-attack/QueenAttackTest.php +++ b/exercises/practice/queen-attack/QueenAttackTest.php @@ -1,12 +1,10 @@ assertFalse(canAttack([4, 1], [2, 5])); } - } From 957e2752e0407292424c1621fd1a7ef7a83c734f Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Mon, 25 May 2026 01:16:05 +0100 Subject: [PATCH 6/9] Revert unintended changes to PalindromeProductsTest.php --- .../PalindromeProductsTest.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/exercises/practice/palindrome-products/PalindromeProductsTest.php b/exercises/practice/palindrome-products/PalindromeProductsTest.php index 4789ccbab..88f5bacde 100644 --- a/exercises/practice/palindrome-products/PalindromeProductsTest.php +++ b/exercises/practice/palindrome-products/PalindromeProductsTest.php @@ -25,7 +25,7 @@ public function testFindsTheSmallestPalindromeFromSingleDigitFactors(): void ]); } - /** + /** * uuid: 0853f82c-5fc4-44ae-be38-fadb2cced92d */ #[TestDox('find the largest palindrome from single digit factors')] @@ -39,7 +39,7 @@ public function testFindsTheLargestPalindromeFromSingleDigitFactors(): void ]); } - /** + /** * uuid: 66c3b496-bdec-4103-9129-3fcb5a9063e1 */ #[TestDox('find the smallest palindrome from double digit factors')] @@ -52,7 +52,7 @@ public function testFindTheSmallestPalindromeFromDoubleDigitFactors(): void ]); } - /** + /** * uuid: a10682ae-530a-4e56-b89d-69664feafe53 */ #[TestDox('find the largest palindrome from double digit factors')] @@ -65,7 +65,7 @@ public function testFindTheLargestPalindromeFromDoubleDigitFactors(): void ]); } - /** + /** * uuid: cecb5a35-46d1-4666-9719-fa2c3af7499d */ #[TestDox('find the smallest palindrome from triple digit factors')] @@ -104,8 +104,6 @@ public function testFindSmallestPalindromeFromFourDigitFactors(): void ]); } - - /** * uuid: 787525e0-a5f9-40f3-8cb2-23b52cf5d0be */ @@ -119,8 +117,7 @@ public function testFindTheLargestPalindromeFromFourDigitFactors(): void ]); } - - /** + /** * uuid: 58fb1d63-fddb-4409-ab84-a7a8e58d9ea0 */ #[TestDox('empty result for smallest if no palindrome in the range')] @@ -131,7 +128,7 @@ public function testEmptyResultForSmallestIfNoPalindromeInTheRange(): void } - /** + /** * uuid: 9de9e9da-f1d9-49a5-8bfc-3d322efbdd02 */ #[TestDox('empty result for largest if no palindrome in the range')] @@ -142,7 +139,7 @@ public function testEmptyResultForLargestIfNoPalindromeInTheRange(): void } - /** + /** * uuid: 12e73aac-d7ee-4877-b8aa-2aa3dcdb9f8a */ #[TestDox('error result for smallest if min is more than max')] @@ -153,7 +150,7 @@ public function testErrorResultForSmallestIfMinIsMoreThanMax(): void } - /** + /** * uuid: eeeb5bff-3f47-4b1e-892f-05829277bd74 */ #[TestDox('error result for largest if min is more than max')] From 7bcbd7721fc412860fc008c22c269cc61cb86136 Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Mon, 25 May 2026 02:54:11 +0100 Subject: [PATCH 7/9] fixe remove exception check for test messages, fixed linting and test names --- .../practice/queen-attack/QueenAttackTest.php | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/exercises/practice/queen-attack/QueenAttackTest.php b/exercises/practice/queen-attack/QueenAttackTest.php index 2f96062d9..ff9cc94b7 100644 --- a/exercises/practice/queen-attack/QueenAttackTest.php +++ b/exercises/practice/queen-attack/QueenAttackTest.php @@ -16,7 +16,7 @@ public static function setUpBeforeClass(): void * uuid: 3ac4f735-d36c-44c4-a3e2-316f79704203 */ #[TestDox('Test creation of Queens with valid and invalid positions -> queen with a valid position')] - public function testCreateQueenWithValidPosition(): void + public function testCreationOfQueensWithValidAndInvalidPositionsCreateQueenWithValidPosition(): void { $this->assertTrue(placeQueen(2, 2)); } @@ -25,11 +25,9 @@ public function testCreateQueenWithValidPosition(): void * uuid: 4e812d5d-b974-4e38-9a6b-8e0492bfa7be */ #[TestDox('Test creation of Queens with valid and invalid positions -> queen must have positive row')] - public function testQueenHasPositiveRank(): void + public function testCreationOfQueensWithValidAndInvalidPositionsQueenMustHavePositiveRow(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('The rank and file numbers must be positive.'); - placeQueen(-2, 2); } @@ -37,11 +35,9 @@ public function testQueenHasPositiveRank(): void * uuid: f07b7536-b66b-4f08-beb9-4d70d891d5c8 */ #[TestDox('Test creation of Queens with valid and invalid positions -> queen must have row on board')] - public function testQueenHasRankOnBoard(): void + public function testCreationOfQueensWithValidAndInvalidPositionsQueenMustHaveRowOnBoard(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('The position must be on a standard size chess board.'); - placeQueen(8, 4); } @@ -49,11 +45,9 @@ public function testQueenHasRankOnBoard(): void * uuid: 15a10794-36d9-4907-ae6b-e5a0d4c54ebe */ #[TestDox('Test creation of Queens with valid and invalid positions -> queen must have positive column')] - public function testQueenHasPositiveFile(): void + public function testCreationOfQueensWithValidAndInvalidPositionsQueenMustHavePositiveColumn(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('The rank and file numbers must be positive.'); - placeQueen(2, -2); } @@ -61,11 +55,9 @@ public function testQueenHasPositiveFile(): void * uuid: 6907762d-0e8a-4c38-87fb-12f2f65f0ce4 */ #[TestDox('Test creation of Queens with valid and invalid positions -> queen must have column on board')] - public function testQueenHasFileOnBoard(): void + public function testCreationOfQueensWithValidAndInvalidPositionsQueenMustHaveColumnOnBoard(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('The position must be on a standard size chess board.'); - placeQueen(4, 8); } @@ -73,7 +65,7 @@ public function testQueenHasFileOnBoard(): void * uuid: 33ae4113-d237-42ee-bac1-e1e699c0c007 */ #[TestDox('Test the ability of one queen to attack another -> cannot attack')] - public function testQueensCanAttack(): void + public function testTheAbilityOfOneQueenToAttackAnotherCannotAttack(): void { $this->assertFalse(canAttack([2, 4], [6, 6])); } @@ -82,7 +74,7 @@ public function testQueensCanAttack(): void * uuid: eaa65540-ea7c-4152-8c21-003c7a68c914 */ #[TestDox('Test the ability of one queen to attack another -> can attack on same row')] - public function testQueensCanAttackOnSameRank(): void + public function testTheAbilityOfOneQueenToAttackAnotherCanAttackOnSameRow(): void { $this->assertTrue(canAttack([2, 4], [2, 6])); } @@ -91,7 +83,7 @@ public function testQueensCanAttackOnSameRank(): void * uuid: bae6f609-2c0e-4154-af71-af82b7c31cea */ #[TestDox('Test the ability of one queen to attack another -> can attack on same column')] - public function testQueensCanAttackOnSameFile(): void + public function testTheAbilityOfOneQueenToAttackAnotherCanAttackOnSameColumn(): void { $this->assertTrue(canAttack([4, 5], [2, 5])); } @@ -100,7 +92,7 @@ public function testQueensCanAttackOnSameFile(): void * uuid: 0e1b4139-b90d-4562-bd58-dfa04f1746c7 */ #[TestDox('Test the ability of one queen to attack another -> can attack on first diagonal')] - public function testQueensCanAttackOnFirstDiagonal(): void + public function testTheAbilityOfOneQueenToAttackAnotherCanAttackOnFirstDiagonal(): void { $this->assertTrue(canAttack([2, 2], [0, 4])); } @@ -109,7 +101,7 @@ public function testQueensCanAttackOnFirstDiagonal(): void * uuid: ff9b7ed4-e4b6-401b-8d16-bc894d6d3dcd */ #[TestDox('Test the ability of one queen to attack another -> can attack on second diagonal')] - public function testQueensCanAttackOnSecondDiagonal(): void + public function testTheAbilityOfOneQueenToAttackAnotherCanAttackOnSecondDiagonal(): void { $this->assertTrue(canAttack([2, 2], [3, 1])); } @@ -118,7 +110,7 @@ public function testQueensCanAttackOnSecondDiagonal(): void * uuid: 0a71e605-6e28-4cc2-aa47-d20a2e71037a */ #[TestDox('Test the ability of one queen to attack another -> can attack on third diagonal')] - public function testQueensCanAttackOnThirdDiagonal(): void + public function testTheAbilityOfOneQueenToAttackAnotherCanAttackOnThirdDiagonal(): void { $this->assertTrue(canAttack([2, 2], [1, 1])); } @@ -127,16 +119,16 @@ public function testQueensCanAttackOnThirdDiagonal(): void * uuid: 0790b588-ae73-4f1f-a968-dd0b34f45f86 */ #[TestDox('Test the ability of one queen to attack another -> can attack on fourth diagonal')] - public function testQueensCanAttackOnFourthDiagonal(): void + public function testTheAbilityOfOneQueenToAttackAnotherCanAttackOnFourthDiagonal(): void { $this->assertTrue(canAttack([1, 7], [0, 6])); } /** * uuid: 543f8fd4-2597-4aad-8d77-cbdab63619f8 - */ + */ #[TestDox('Test the ability of one queen to attack another -> cannot attack if falling diagonals are only the same when reflected across the longest falling diagonal')] - public function testQueensCannotAttackReflectedDiagonal(): void + public function testTheAbilityOfOneQueenToAttackAnotherCannotAttackReflectedDiagonal(): void { $this->assertFalse(canAttack([4, 1], [2, 5])); } From e6b06f96a6f7505dd4da9ed61586ce8c5ef1eae7 Mon Sep 17 00:00:00 2001 From: Obinna Obi-Akwari <111562983+A-O-Emmanuel@users.noreply.github.com> Date: Mon, 25 May 2026 16:59:21 +0100 Subject: [PATCH 8/9] Update exercises/practice/queen-attack/QueenAttackTest.php Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com> --- exercises/practice/queen-attack/QueenAttackTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/queen-attack/QueenAttackTest.php b/exercises/practice/queen-attack/QueenAttackTest.php index ff9cc94b7..e14ccae0e 100644 --- a/exercises/practice/queen-attack/QueenAttackTest.php +++ b/exercises/practice/queen-attack/QueenAttackTest.php @@ -12,7 +12,7 @@ public static function setUpBeforeClass(): void require_once 'QueenAttack.php'; } - /** + /** * uuid: 3ac4f735-d36c-44c4-a3e2-316f79704203 */ #[TestDox('Test creation of Queens with valid and invalid positions -> queen with a valid position')] From b6c89fef2f64c5801608c995d966e66aa02116d2 Mon Sep 17 00:00:00 2001 From: Obinna Obi-Akwari <111562983+A-O-Emmanuel@users.noreply.github.com> Date: Mon, 25 May 2026 16:59:40 +0100 Subject: [PATCH 9/9] Update exercises/practice/queen-attack/QueenAttackTest.php Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com> --- exercises/practice/queen-attack/QueenAttackTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/queen-attack/QueenAttackTest.php b/exercises/practice/queen-attack/QueenAttackTest.php index e14ccae0e..54156fadb 100644 --- a/exercises/practice/queen-attack/QueenAttackTest.php +++ b/exercises/practice/queen-attack/QueenAttackTest.php @@ -125,7 +125,7 @@ public function testTheAbilityOfOneQueenToAttackAnotherCanAttackOnFourthDiagonal } /** - * uuid: 543f8fd4-2597-4aad-8d77-cbdab63619f8 + * uuid: 543f8fd4-2597-4aad-8d77-cbdab63619f8 */ #[TestDox('Test the ability of one queen to attack another -> cannot attack if falling diagonals are only the same when reflected across the longest falling diagonal')] public function testTheAbilityOfOneQueenToAttackAnotherCannotAttackReflectedDiagonal(): void