Sierpinski triangle: Difference between revisions
Content deleted Content added
Line 431: | Line 431: | ||
triangle(N-1, NewDown, Sp++Sp). |
triangle(N-1, NewDown, Sp++Sp). |
||
</lang> |
</lang> |
||
=={{header|F_sharp|F#}}== |
|||
<lang fsharp>let sierpinski n = |
|||
let rec loop down space n = |
|||
if n = 0 then |
|||
down |
|||
else |
|||
loop (List.map (fun x -> space + x + space) down @ |
|||
List.map (fun x -> x + " " + x) down) |
|||
(space + space) |
|||
(n - 1) |
|||
in loop ["*"] " " n |
|||
let () = |
|||
List.iter (fun (i:string) -> System.Console.WriteLine(i)) (sierpinski 4)</lang> |
|||
=={{header|FALSE}}== |
=={{header|FALSE}}== |