Skip to content

Instantly share code, notes, and snippets.

@marrub--

marrub--/jort.ml Secret

Last active September 8, 2018 14:14
Show Gist options
  • Save marrub--/b13e8bd6a7e5f8ce10a1ff2f48fed228 to your computer and use it in GitHub Desktop.
Save marrub--/b13e8bd6a7e5f8ce10a1ff2f48fed228 to your computer and use it in GitHub Desktop.
let rec rep n s = if n = 0 then "" else s ^ rep (n - 1) s;;
let rec jort n st =
if n > 1 then
let j = rep n " jort"
and k = rep (n - 1) " jort" in
let l = "jean short" ^ k ^ "s (" ^ (jort (n - 1) false) ^ ")" in
if st then j ^ "s (" ^ l ^ ")" else l
else
"jean shorts";;
let jort n = jort n true;;
print_endline (jort 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment