aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacky Anderson <packy@cpan.org>2025-07-05 00:07:49 -0400
committerPacky Anderson <packy@cpan.org>2025-07-05 00:07:49 -0400
commitb07cf8c4ccd2cd032e99bc5c14891851fec4dda1 (patch)
treedc8b6fd499f9c6f859cc0adcb2ba9fb4eb30e0fc
parent78f2af30aefdcdb9276d0edbd0449f78c78275f4 (diff)
downloadperlweeklychallenge-club-b07cf8c4ccd2cd032e99bc5c14891851fec4dda1.tar.gz
perlweeklychallenge-club-b07cf8c4ccd2cd032e99bc5c14891851fec4dda1.tar.bz2
perlweeklychallenge-club-b07cf8c4ccd2cd032e99bc5c14891851fec4dda1.zip
Fix Elixir case.
-rwxr-xr-xchallenge-328/packy-anderson/elixir/ch-1.exs6
1 files changed, 3 insertions, 3 deletions
diff --git a/challenge-328/packy-anderson/elixir/ch-1.exs b/challenge-328/packy-anderson/elixir/ch-1.exs
index e396a61f9f..67d0bfd191 100755
--- a/challenge-328/packy-anderson/elixir/ch-1.exs
+++ b/challenge-328/packy-anderson/elixir/ch-1.exs
@@ -1,7 +1,7 @@
#!/usr/bin/env elixir
defmodule PWC do
- def replaceAllQuestion(str) do
+ def replace_all_question(str) do
match = Regex.named_captures(
~r/(?<before>.)\?+(?<after>.)/,
str
@@ -13,7 +13,7 @@ defmodule PWC do
replace = ?a..?z |> Enum.take_random(1) |> List.to_string
str = Regex.replace(~r/\?/, str, replace, global: false)
# recursively call this function to replace any remaining ?s
- replaceAllQuestion(str)
+ replace_all_question(str)
else
# return the unmodified string if there are no ? characters
str
@@ -22,7 +22,7 @@ defmodule PWC do
def solution(str) do
IO.puts("Input: $str = \"#{str}\"")
- IO.puts("Output: \"#{replaceAllQuestion(str)}\"")
+ IO.puts("Output: \"#{replace_all_question(str)}\"")
end
end