Jump to content

Pangram checker: Difference between revisions

→‎{{header|AppleScript}}: Added a simple core language solution.
(Add Draco)
(→‎{{header|AppleScript}}: Added a simple core language solution.)
Line 269:
 
=={{header|AppleScript}}==
===AppleScriptObjC===
 
Out of the box, AppleScript lacks many library basics – no regex, no higher order functions, not even string functions for mapping to upper or lower case.
 
Line 353:
{{Out}}
<lang AppleScript>{false, true}</lang>
----
===Core language===
Contrary to the impression given above, AppleScript is perfectly capable of handling this task very simply and without the need for imported libraries.
<lang applescript>on isPangram(txt)
set alphabet to "abcedfghijklmnopqrstuvwxyz"
ignoring case -- The default, but ensure it here.
repeat with letter in alphabet
if (txt does not contain letter) then return false
end repeat
end ignoring
return true
end isPangram
 
local result1, result2
set result1 to isPangram("The Quick Brown Fox Jumps Over The Lazy Dog")
set result2 to isPangram("This is not a pangram")
return {result1, result2}</lang>
 
{{output}}
<lang applescript>{true, false}</lang>
 
=={{header|Arturo}}==
557

edits

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