Jump to content

Pangram checker: Difference between revisions

(Add Comal)
Line 2,705:
Yes
</pre>
 
=={{header|Picat}}==
<lang Picat>go =>
S1 = "The quick brown fox jumps over the lazy dog",
S2 = "The slow brown fox jumps over the lazy dog",
println([S1, is_pangram(S1)]),
println([S2, is_pangram(S2)]),
nl,
println("With missing chars:"),
println([S1, is_pangram2(S1)]),
println([S2, is_pangram2(S2)]),
nl.
 
% Check if S is a pangram and get the missing chars
is_pangram(S) = P =>
Lower = S.to_lowercase,
Alpha = [chr(I+96) : I in 1..26],
foreach(A in Alpha) membchk(A,Lower) end -> P = true ; P = false.
 
% Check if S is a pangram and get the missing chars (if any)
is_pangram2(S) = [pangram=cond(Missing==[],true,false),missing=Missing] =>
Lower = S.to_lowercase,
Missing = [A : A in [chr(I+96) : I in 1..26], not membchk(A,Lower)].</lang>
 
{{out}}
<pre>[The quick brown fox jumps over the lazy dog,true]
[The slow brown fox jumps over the lazy dog,false]
 
With missing chars:
[The quick brown fox jumps over the lazy dog,[pangram = true,missing = []]]
[The slow brown fox jumps over the lazy dog,[pangram = false,missing = cikq]]</pre>
 
=={{header|PicoLisp}}==
495

edits

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