Anonymous user
Sierpinski triangle/Graphical: Difference between revisions
→{{header|Python}}: add much simpler version
(Erlang solution.) |
(→{{header|Python}}: add much simpler version) |
||
Line 1,594:
=={{header|Python}}==
{{libheader|Turtle}}
<lang python>
# likely the simplest possible version?
import turtle as t
def sier(n,length):
if (n==0):
return
for i in range(3):
sier(n-1, length/2)
t.fd(length)
t.rt(120)
</lang>
{{libheader|NumPy}}
{{libheader|Turtle}}
Line 1,599 ⟶ 1,612:
<lang python>#!/usr/bin/env python
##########################################################################################
# a very complicated version
# import necessary modules
# ------------------------
|