31 lines
841 B
Text
31 lines
841 B
Text
include c:\cxpl\codes; \intrinsic 'code' declarations
|
|
string 0; \use zero-terminated strings
|
|
|
|
func StrLen(Str); \Return number of characters in an ASCIIZ string
|
|
char Str;
|
|
int I;
|
|
for I:= 0 to -1>>1-1 do
|
|
if Str(I) = 0 then return I;
|
|
|
|
func Pangram(S);
|
|
char S;
|
|
int A, I, C;
|
|
[A:= 0;
|
|
for I:= 0 to StrLen(S)-1 do
|
|
[C:= S(I);
|
|
if C>=^A & C<=^Z then C:= C or $20;
|
|
if C>=^a & C<=^z then [C:= C - ^a; A:= A or 1<<C];
|
|
];
|
|
return A = $3FFFFFF;
|
|
]; \Pangram
|
|
|
|
int Sentence, I;
|
|
[Sentence:=
|
|
["The quick brown fox jumps over the lazy dog.",
|
|
"Pack my box with five dozen liquor jugs.",
|
|
"Now is the time for all good men to come to the aid of their country."];
|
|
for I:= 0 to 3-1 do
|
|
[Text(0, if Pangram(Sentence(I)) then "yes" else "no");
|
|
CrLf(0);
|
|
];
|
|
]
|