(original) (raw)

#!/usr/bin/env setl -- -- Pangram checker in SETL -- -- http://rosettacode.org/wiki/Pangram\_checker -- """ -- Write a function or method to check a sentence to see if it is a -- pangram or not and show its use. -- -- A pangram is a sentence that contains all the letters of the -- English alphabet at least once, for example: The quick brown fox jumps -- over the lazy dog. -- """ -- -- This SETL program was created by Hakan Kjellerstrand (hakank@bonetmail.com) -- Also see my SETL page: http://www.hakank.org/setl/ -- s1 := "The quick brown fox jumps over the lazy dog"; print(s1,is_pangram(s1)); print(s1,is_pangram1(s1)); s2 := "The fox jumps over the lazy dog"; print(s2,is_pangram(s2)); print(s2,is_pangram1(s2)); proc is_pangram(s); return forall c in "abcdefghijklmnopqrstuvwxyz" | c in to_lower(s); end proc; -- another version proc is_pangram1(s); chars := {c : c in to_lower(s)}; for c in "abcdefghijklmnopqrstuvwxyz" loop if not c in chars then return false; end if; end loop; return true; end proc;