From 21665e4141a9414663c23bcd8301d17f449cde08 Mon Sep 17 00:00:00 2001 From: Jeremy Walker Date: Sat, 7 Nov 2026 17:00:26 +0900 Subject: [PATCH] Add a sign-up snippet The Exercism sign-up page shows this code sample to people who say they can code a little, to check whether they understand coding basics. The maintainers-admin team owns the file. Co-Authored-By: Claude Opus 5.5 --- .github/CODEOWNERS | 3 +++ docs/SIGN_UP_SNIPPET.txt | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 docs/SIGN_UP_SNIPPET.txt diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 20408047..b5b0dfcd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1,9 @@ # Code owners .github/CODEOWNERS @exercism/maintainers-admin +# The code sample shown in the code check when people sign up to Exercism +docs/SIGN_UP_SNIPPET.txt @exercism/maintainers-admin + # Changes to `fetch-configlet` should be made in the `exercism/configlet` repo bin/fetch-configlet @exercism/maintainers-admin diff --git a/docs/SIGN_UP_SNIPPET.txt b/docs/SIGN_UP_SNIPPET.txt new file mode 100644 index 00000000..ba3dd94f --- /dev/null +++ b/docs/SIGN_UP_SNIPPET.txt @@ -0,0 +1,11 @@ +local function most_common_word(text) + local counts = {} + local best = "" + for word in text:lower():gmatch("%S+") do + counts[word] = (counts[word] or 0) + 1 + if counts[word] > (counts[best] or 0) then + best = word + end + end + return string.format('"%s" appears %d times', best, counts[best]) +end