fork download
  1. let exch chr =
  2. match chr with
  3. 'a' -> 'C'
  4. |'b' -> 'A'
  5. |'c' -> 'D'
  6. |'d' -> 'B';;
  7.  
  8. let rec crypt str ?(num=0) =
  9. str.[num] <- exch [num]
  10. if num > String.length str then crypt str num+1;;
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
File "prog.ml", line 10, characters 2-4:
Syntax error: ']' expected
File "prog.ml", line 9, characters 6-7:
This '[' might be unmatched
stdout
Standard output is empty