Jump to content

Pangram checker: Difference between revisions

m
(Add BCPL)
Line 216:
<lang AppleScript>use framework "Foundation" -- ( for case conversion function )
 
-- PANGRAM CHECK ---------------------------------------- PANGRAM CHECK ---------------------
 
-- isPangram :: String -> Bool
Line 227:
end script
0 = length of filter(charUnUsed, "abcdefghijklmnopqrstuvwxyz") = 0¬
"abcdefghijklmnopqrstuvwxyz")
end isPangram
 
 
-- TEST --------------------------------------------- TEST -------------------------
on run
map(isPangram, {¬
Line 240 ⟶ 241:
end run
 
 
-- GENERIC FUNCTIONS -------------------------------------- GENERIC FUNCTIONS -------------------
 
-- filter :: (a -> Bool) -> [a] -> [a]
Line 254 ⟶ 256:
end tell
end filter
 
 
-- map :: (a -> b) -> [a] -> [b]
Line 267 ⟶ 270:
end map
 
 
-- Lift 2nd class handler function into 1st class script wrapper
-- 1st class script wrapper
-- mReturn :: Handler -> Script
on mReturn(f)
Line 278 ⟶ 283:
end if
end mReturn
 
 
-- toLower :: String -> String
9,659

edits

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