Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Pangram-checker/OCaml/pangram-checker-1.ocaml
Normal file
7
Task/Pangram-checker/OCaml/pangram-checker-1.ocaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let pangram str =
|
||||
let ar = Array.make 26 false in
|
||||
String.iter (function
|
||||
| 'a'..'z' as c -> ar.(Char.code c - Char.code 'a') <- true
|
||||
| _ -> ()
|
||||
) (String.lowercase str);
|
||||
Array.fold_left ( && ) true ar
|
||||
7
Task/Pangram-checker/OCaml/pangram-checker-2.ocaml
Normal file
7
Task/Pangram-checker/OCaml/pangram-checker-2.ocaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let check str =
|
||||
Printf.printf " %b -- %s\n" (pangram str) str
|
||||
|
||||
let () =
|
||||
check "this is a sentence";
|
||||
check "The quick brown fox jumps over the lazy dog.";
|
||||
;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue