Jump to content

Pangram checker: Difference between revisions

Line 281:
 
<lang AppleScript>{false, true}</lang>
 
=={{header|ATS}}==
<lang ATS>
(* ****** ****** *)
//
#include
"share/atspre_staload.hats"
#include
"share/HATS/atspre_staload_libats_ML.hats"
//
(* ****** ****** *)
//
fun
string_check
(
cs: string, c0: char
) : bool = cs.exists()(lam(c) => c0 = c)
//
(* ****** ****** *)
 
fun
Pangram_check
(text: string): bool = let
//
val
alphabet = "abcdefghijklmnopqrstuvwxyz"
val
((*void*)) = assertloc(length(alphabet) = 26)
//
in
alphabet.forall()(lam(c) => string_check(text, c) || string_check(text, toupper(c)))
end // end of [Pangram_check]
 
(* ****** ****** *)
 
implement
main0 () =
{
//
val
text0 = "The quick brown fox jumps over the lazy dog."
//
val-true = Pangram_check(text0)
val-false = Pangram_check("This is not a pangram sentence.")
//
} (* end of [main0] *)
 
(* ****** ****** *)
</lang>
 
=={{header|AutoHotkey}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.