diff --git a/bin/auto-sync.txt b/bin/auto-sync.txt index e74773c2c..262964b06 100644 --- a/bin/auto-sync.txt +++ b/bin/auto-sync.txt @@ -62,6 +62,7 @@ pig-latin protein-translation proverb queen-attack +rail-fence-cipher raindrops reverse-string rna-transcription diff --git a/exercises/practice/rail-fence-cipher/.docs/instructions.md b/exercises/practice/rail-fence-cipher/.docs/instructions.md index 0e75a2bf7..e311de6cd 100644 --- a/exercises/practice/rail-fence-cipher/.docs/instructions.md +++ b/exercises/practice/rail-fence-cipher/.docs/instructions.md @@ -2,15 +2,13 @@ Implement encoding and decoding for the rail fence cipher. -The Rail Fence cipher is a form of transposition cipher that gets its name from -the way in which it's encoded. It was already used by the ancient Greeks. +The Rail Fence cipher is a form of transposition cipher that gets its name from the way in which it's encoded. +It was already used by the ancient Greeks. -In the Rail Fence cipher, the message is written downwards on successive "rails" -of an imaginary fence, then moving up when we get to the bottom (like a zig-zag). +In the Rail Fence cipher, the message is written downwards on successive "rails" of an imaginary fence, then moving up when we get to the bottom (like a zig-zag). Finally the message is then read off in rows. -For example, using three "rails" and the message "WE ARE DISCOVERED FLEE AT ONCE", -the cipherer writes out: +For example, using three "rails" and the message "WE ARE DISCOVERED FLEE AT ONCE", the cipherer writes out: ```text W . . . E . . . C . . . R . . . L . . . T . . . E diff --git a/exercises/practice/rail-fence-cipher/.meta/config.json b/exercises/practice/rail-fence-cipher/.meta/config.json index 6546e2eee..8ecc83053 100644 --- a/exercises/practice/rail-fence-cipher/.meta/config.json +++ b/exercises/practice/rail-fence-cipher/.meta/config.json @@ -6,7 +6,8 @@ "arueckauer", "kunicmarko20", "kytrinyx", - "yisraeldov" + "yisraeldov", + "A-O-Emmanuel" ], "files": { "solution": [ diff --git a/exercises/practice/rail-fence-cipher/.meta/example.php b/exercises/practice/rail-fence-cipher/.meta/example.php index 6d15f309c..59b31b8c3 100644 --- a/exercises/practice/rail-fence-cipher/.meta/example.php +++ b/exercises/practice/rail-fence-cipher/.meta/example.php @@ -1,27 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); function encode($plainMessage, $rails) diff --git a/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php b/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php index 3e808a2e6..bea4e33af 100644 --- a/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php +++ b/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php @@ -1,30 +1,9 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\TestDox; class RailFenceCipherTest extends TestCase { @@ -34,8 +13,9 @@ public static function setUpBeforeClass(): void } /** - * Test encode with two rails. + * uuid 46dc5c50-5538-401d-93a5-41102680d068 */ + #[TestDox('encode with two rails')] public function testEncodeWithTwoRails(): void { $plainText = "XOXOXOXOXOXOXOXOXO"; @@ -43,9 +23,11 @@ public function testEncodeWithTwoRails(): void $expected = "XXXXXXXXXOOOOOOOOO"; $this->assertEquals($expected, encode($plainText, $rails)); } + /** - * Test encode with three rails. + * uuid 25691697-fbd8-4278-8c38-b84068b7bc29 */ + #[TestDox('encode with three rails')] public function testEncodeWithThreeRails(): void { $plainText = "WEAREDISCOVEREDFLEEATONCE"; @@ -55,8 +37,9 @@ public function testEncodeWithThreeRails(): void } /** - * Test encode with ending in the middle. + * uuid 384f0fea-1442-4f1a-a7c4-5cbc2044002c */ + #[TestDox('encode with ending in the middle')] public function testEncodeWithEndingInTheMiddle(): void { $plainText = "EXERCISES"; @@ -66,8 +49,9 @@ public function testEncodeWithEndingInTheMiddle(): void } /** - * Test decode with three rails. + * uuid cd525b17-ec34-45ef-8f0e-4f27c24a7127 */ + #[TestDox('decode with three rails')] public function testDecodeWithThreeRails(): void { $encryptedText = "TEITELHDVLSNHDTISEIIEA"; @@ -75,9 +59,11 @@ public function testDecodeWithThreeRails(): void $expected = "THEDEVILISINTHEDETAILS"; $this->assertEquals($expected, decode($encryptedText, $rails)); } + /** - * Test decode with five rails. + * uuid dd7b4a98-1a52-4e5c-9499-cbb117833507 */ + #[TestDox('decode with five rails')] public function testDecodeWithFiveRails(): void { $encryptedText = "EIEXMSMESAORIWSCE"; @@ -87,8 +73,9 @@ public function testDecodeWithFiveRails(): void } /** - * Test decode with six rails. + * uuid 93e1ecf4-fac9-45d9-9cd2-591f47d3b8d3 */ + #[TestDox('decode with six rails')] public function testDecodeWithSixRails(): void { $encryptedText = "133714114238148966225439541018335470986172518171757571896261";