let table rows =
  let buf = Buffer.create 64 in
  List.iter (fun (name, score) ->
    Buffer.add_string buf (Printf.sprintf "%-10s %4d\n" name score)
  ) rows;
  Buffer.contents buf

;;

String.length (table [("alice", 95); ("bob", 67); ("carol", 100); ("dave", 8)])
