Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Pangram-checker/BCPL/pangram-checker.bcpl
Normal file
28
Task/Pangram-checker/BCPL/pangram-checker.bcpl
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
get "libhdr"
|
||||
|
||||
// Test if s is a pangram. The ASCII character set is assumed.
|
||||
let pangram(s) = valof
|
||||
$( let letters = vec 25
|
||||
for i=0 to 25 do letters!i := false
|
||||
for i=1 to s%0 do
|
||||
$( let c = (s%i | 32) - 'a'
|
||||
if c >= 0 & c < 26 then
|
||||
letters!c := true
|
||||
$)
|
||||
for i=0 to 25 unless letters!i resultis false
|
||||
resultis true
|
||||
$)
|
||||
|
||||
// Display s and whether or not it is a pangram.
|
||||
let check(s) be
|
||||
$( writes(s)
|
||||
writes(" -> ")
|
||||
test pangram(s)
|
||||
then writes("yes*N")
|
||||
else writes("no*N")
|
||||
$)
|
||||
|
||||
let start() be
|
||||
$( check("The quick brown fox jumps over the lazy dog.")
|
||||
check("The five boxing wizards dump quickly.")
|
||||
$)
|
||||
Loading…
Add table
Add a link
Reference in a new issue