diff options
| author | James Smith <js5@sanger.ac.uk> | 2023-03-20 22:54:24 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-20 22:54:24 +0000 |
| commit | 60f4518b353390ccd821bc973fd5ac7619deb526 (patch) | |
| tree | dcfe3f508d6ea6c52f8e0f8a86d7a79f905fe9f7 | |
| parent | a211182f33e82c555fbbf729e124fd667f3d1b44 (diff) | |
| download | perlweeklychallenge-club-60f4518b353390ccd821bc973fd5ac7619deb526.tar.gz perlweeklychallenge-club-60f4518b353390ccd821bc973fd5ac7619deb526.tar.bz2 perlweeklychallenge-club-60f4518b353390ccd821bc973fd5ac7619deb526.zip | |
Update ch-1.pl
| -rw-r--r-- | challenge-209/james-smith/perl/ch-1.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/challenge-209/james-smith/perl/ch-1.pl b/challenge-209/james-smith/perl/ch-1.pl index 98ddd16e71..c5a908afd5 100644 --- a/challenge-209/james-smith/perl/ch-1.pl +++ b/challenge-209/james-smith/perl/ch-1.pl @@ -17,3 +17,9 @@ sub special_bit_chars { ($_[0]&&shift),shift until @_<2; scalar @_ } + +sub special_bit_chars_reverse { + my$f,pop?return-1:pop||return 1; + $f=!$f,pop||last while@_; + ~~$f +} |
