Hilbert curve: Difference between revisions

Content deleted Content added
Hout (talk | contribs)
→‎{{header|Python}}: Added a Python draft - composing pure functions.
Hout (talk | contribs)
m →‎Functional Python: (One addition comment for clarity, minor edit to preamble)
Line 967:
An SVG path is serialised from the Nth application of re-write rules to a Hilbert tree structure.
 
(SaveTo view the Hilbert curve, save the output SVG text in a file, and loadopen init browser,with toa view the Hilbert curvebrowser).
 
<lang Python>from itertools import (chain, islice, starmap)
Line 1,024:
# points :: Int -> ((Int, Int), Tree Char) -> [(Int, Int)]
def points(d):
'''Size -> subtree with its center -> All subtree points'''
def go(xy, tree):
r = d // 2
Line 1,087 ⟶ 1,088:
hilbertCurve(6)
)</lang>
 
 
=={{header|Ring}}==