diff options
| author | Packy Anderson <packy@cpan.org> | 2025-07-05 00:07:49 -0400 |
|---|---|---|
| committer | Packy Anderson <packy@cpan.org> | 2025-07-05 00:07:49 -0400 |
| commit | b07cf8c4ccd2cd032e99bc5c14891851fec4dda1 (patch) | |
| tree | dc8b6fd499f9c6f859cc0adcb2ba9fb4eb30e0fc | |
| parent | 78f2af30aefdcdb9276d0edbd0449f78c78275f4 (diff) | |
| download | perlweeklychallenge-club-b07cf8c4ccd2cd032e99bc5c14891851fec4dda1.tar.gz perlweeklychallenge-club-b07cf8c4ccd2cd032e99bc5c14891851fec4dda1.tar.bz2 perlweeklychallenge-club-b07cf8c4ccd2cd032e99bc5c14891851fec4dda1.zip | |
Fix Elixir case.
| -rwxr-xr-x | challenge-328/packy-anderson/elixir/ch-1.exs | 6 |
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 |
