aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark A <andemark@a-iot1t.uch.ad.pvt>2021-08-22 22:45:53 -0600
committerMark A <andemark@a-iot1t.uch.ad.pvt>2021-08-22 22:45:53 -0600
commitd2b0ce69bfd1c352717b2e5ef1944c59e643e8b0 (patch)
tree853dd7906a2dcebbd0b48882913f34792ff413fa
parent64b474ba7765f147d95b6bd45f981716fa2c8d5c (diff)
downloadperlweeklychallenge-club-d2b0ce69bfd1c352717b2e5ef1944c59e643e8b0.tar.gz
perlweeklychallenge-club-d2b0ce69bfd1c352717b2e5ef1944c59e643e8b0.tar.bz2
perlweeklychallenge-club-d2b0ce69bfd1c352717b2e5ef1944c59e643e8b0.zip
Last minute change
-rw-r--r--challenge-126/mark-anderson/raku/ch-1.raku8
1 files changed, 3 insertions, 5 deletions
diff --git a/challenge-126/mark-anderson/raku/ch-1.raku b/challenge-126/mark-anderson/raku/ch-1.raku
index c83b03f868..c2c267fb21 100644
--- a/challenge-126/mark-anderson/raku/ch-1.raku
+++ b/challenge-126/mark-anderson/raku/ch-1.raku
@@ -1,9 +1,9 @@
#!/usr/bin/env raku
# The adjust function adjusts the number if it contains a 1
-# Examples: 111 is converted to 99
-# 901 is converted to 900
-# 2731515 is converted to 2730999
+# Examples: adjust(111) = 99
+# adjust(901) = 900
+# adjust(2731515) = 2730999
# The count-numbers function performs this equivalent algorithm:
# For all digits, subtract 1 and multiply that by 9 raised to the
@@ -49,7 +49,5 @@ sub adjust($N is copy)
return $N if @a.elems == 1; # $N has no 1s
@a.tail = 0 ~ 9 x @a.tail.chars;
-
- return +@a.tail unless @a.head; # first digit of $N is 1
return @a.join;
}