fork download
  1. let sierpinski =
  2. let rec loop down space = function
  3. 0 -> down
  4. | n ->
  5. loop (List.map (fun x -> space + x + space) down
  6. @ List.map (fun x -> x + " " + x) down)
  7. (space + space)
  8. (n - 1)
  9. loop ["*"] " "
  10.  
  11. let input () =
  12. match System.Console.ReadLine ()
  13. |> System.Int32.TryParse with
  14. n, true -> true
  15. | _ -> 0
  16.  
  17. input ()
  18. |> sierpinski
  19. |> List.iter (printfn "%s")
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
4
compilation info
/home/JWGmCL/prog.fs(14,8): error FS0001: This expression was expected to have type
    int    
but here has type
    bool    
stdout
Standard output is empty