About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
November 2010
<<October November December>>
Fixing m to be a power of 2; setting k and l to be zero; and looping i and j over the range [1,m], we get an integer f(i,j,k,l,m) for each pair (i,j).
Drawing a point on the j-th row of the i-th line when f(i,j,0,0,m) is zero and leaving it blank when it is not yields the Hilbert space-filling curve, which is a fractal.We received two interesting answers. The first was from John Tromp, who sent us a magnificent C program that generates this curve and has its shape:
The second was from Tim Tran, who switched the order, fixed i and j, and looped with k and l, producing a fractal-like construct:
If you have any problems you think we might enjoy, please send them in. All replies should be sent to: ponder@il.ibm.com