Advertisement
Guest User

Untitled

a guest
Jun 14th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.85 KB | None | 0 0
  1. let f (str:string) =
  2.     let mutable s =
  3.         str.ToCharArray()
  4.         |> Array.map (fun x -> match x with
  5.                                 | '3' -> 'e'
  6.                                 | '0' -> 'o'
  7.                                 | '1' -> 'l'
  8.                                 | '7' -> 'r'
  9.                                 | _   ->  x)
  10.     for i = 0 to s.Length - 1 do
  11.         match s.[i] with
  12.         | '|'  -> if s.[i+1] = '-' then
  13.                      s.[i]   <- 'H'
  14.                      for j in [1..2] do s.[i+j] <- '='
  15.                   if s.[i+1] = ')' then
  16.                      s.[i]   <- 'd'
  17.                      s.[i+1] <- '='
  18.         | '\\' -> s.[i] <- 'W'
  19.                   for j in [1..3] do s.[i+j] <- '='
  20.         | _    -> ()
  21.     s
  22.     |> Array.filter ((<>)'=')
  23.        
  24.  
  25. open System
  26. Console.WriteLine(f "|-|3110 \/\/071|)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement