Jump to content

Pangram checker: Difference between revisions

→‎{{header|UNIX Shell}}: Make portable across shells, remove unneeded quotes
m (→‎{{header|Raku}}: add missing necessary semicolon, remove redundant optional semicolon)
(→‎{{header|UNIX Shell}}: Make portable across shells, remove unneeded quotes)
Line 3,354:
=={{header|UNIX Shell}}==
{{works with|Bourne Again SHell}}
{{works with|Korn Shell}}
<syntaxhighlight lang="bash">function pangram? {
{{works with|Z Shell}}
local alphabet=abcdefghijklmnopqrstuvwxyz
<syntaxhighlight lang="bash">function pangram?is_pangram {
local string="$*"
localtypeset alphabet=abcdefghijklmnopqrstuvwxyz
string="${string,,}"
while [[typeset -nl "$string" && -n "=$alphabet" ]]; do*
while [[ local-n ch="${string%% && -n ${string#?}}"alphabet ]]; do
stringtypeset ch="${string%%${string#?}"}
alphabetstring="${alphabet/$chstring#?}"
alphabet=${alphabet/$ch}
done
[[ -z "$alphabet" ]]
}</syntaxhighlight>
 
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.