let digit_list_to_int (dl : string) : int = if String.length dl = 3 then (try int_of_string dl with _ -> raise IllegalChar) else raise IllegalChar