Skip to content

Instantly share code, notes, and snippets.

@cohalz
Created January 19, 2014 15:57
Show Gist options
  • Save cohalz/8506777 to your computer and use it in GitHub Desktop.
Save cohalz/8506777 to your computer and use it in GitHub Desktop.
let max_ascii str =
let rec itermax(i,str,max,length) =
if i >= length then max
else if int_of_char(str.[i]) > max then itermax(i+1,str,int_of_char(str.[i]),length)
else itermax(i+1,str,max,length) in
itermax(0,str,0,String.length str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment