diff options
| author | Simon Green <mail@simon.green> | 2020-08-09 21:22:13 +1000 |
|---|---|---|
| committer | Simon Green <mail@simon.green> | 2020-08-09 21:22:13 +1000 |
| commit | ef5d50a6ba38f1fe9e6acf66df2bba796c171cf5 (patch) | |
| tree | 2d36b308afa94792b7c79bb9b4964e5947808166 /challenge-071 | |
| parent | 7f3dde6f89d1d0df575807e0ec56a07a191cd7bb (diff) | |
| download | perlweeklychallenge-club-ef5d50a6ba38f1fe9e6acf66df2bba796c171cf5.tar.gz perlweeklychallenge-club-ef5d50a6ba38f1fe9e6acf66df2bba796c171cf5.tar.bz2 perlweeklychallenge-club-ef5d50a6ba38f1fe9e6acf66df2bba796c171cf5.zip | |
Simon's solution to challenge 72
Diffstat (limited to 'challenge-071')
| -rw-r--r-- | challenge-071/sgreen/README.md | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/challenge-071/sgreen/README.md b/challenge-071/sgreen/README.md deleted file mode 100644 index 0f43e97b94..0000000000 --- a/challenge-071/sgreen/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Perl Weekly Challenge 070 - -Solution by Simon Green. - - -## TASK #1 › Character Swapping - -For this I used the fact that `($a, $b) = ($b, a)` does what it should. Therefore it was a simple exercise of doing this for `$C` times, and then display the output. - -The task states that `$C + $O <= $O`. This however is not possible. When `$C + $O = $N`, you will get a `substr outside of string` error. For this reason, I've only allowed `$C + $O < $N` to be valid. - -### Example - - » ./ch-1.pl perlandraku 3 4 - pndraerlaku - - » perl/ch-1.pl helloworld 8 1 - hlloworlde - -## TASK 2 › Gray Code Sequence - -Not really much to say about this task, as it is string forward. Given that `$N` can not be greater than five, I simply stored the array in memory. Even at 24 bits, it will run without any issues. - -## Example - - » ./ch-2.pl 4 - 0 1 3 2 6 7 5 4 12 13 15 14 10 11 9 8 |
