Hilbert curve: Difference between revisions
m
→Functional Python: (One addition comment for clarity, minor edit to preamble)
(→{{header|Python}}: Added a Python draft - composing pure functions.) |
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.
(
<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}}==
|