Sha256: a87f8a14ff9e03e540caf7592716639920dcda1ec66dade6a8876e2d1bd92b65

Contents?: true

Size: 506 Bytes

Versions: 68

Compression:

Stored size: 506 Bytes

Contents

open Base

exception Finished of int

let is_pangram s = 
  let alphabet_bits = (1 lsl 26) - 1 in
  let update_bits return b ch =  
    let updated = 
      if Char.is_alpha ch 
      then b lor (1 lsl (Char.to_int (Char.uppercase ch) - Char.to_int 'A'))
      else b in 
    if updated = alphabet_bits then return alphabet_bits else updated
  in
  let return s = raise (Finished s) in
  try
    String.fold s ~init:0 ~f:(update_bits return) = alphabet_bits
  with
    Finished s -> Int.(s = alphabet_bits)

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.138 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.137 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.136 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.135 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.134 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.133 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.132 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.131 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.130 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.129 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.128 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.127 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.126 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.125 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.124 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.123 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.122 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.121 tracks/ocaml/exercises/pangram/example.ml
trackler-2.2.1.120 tracks/ocaml/exercises/pangram/example.ml