Jump to content

Peano curve: Difference between revisions

m
(Add Ada)
Line 528:
=={{header|J}}==
This Hilbert variant is taken directly from the j lab "viewmat".
<prelang j>
load'viewmat'
hp=: 3 : '(|.,]) 1 (0 _2 _2 ,&.> _2 _1 0 + #y) } (,.|:) y'
Line 534:
WR=: 16777215 16711680
viewrgb WR {~ hp ^:7 HP
</prelang j>
 
Or, a smaller [[j:File:Hp1.png|example]] (6 iterations instead of 7) and a different color selection:<lang J> require 'viewmat'
hp=: 3 : '(|.,]) 1 (0 _2 _2 ,&.> _2 _1 0 + #y) } (,.|:) y'
MG=: 256 #. 128 0 128,:0 192 0
viewrgb 2 ([ # #"1) MG {~ hp ^:6 [ 0, 0 1 0 ,: 0,/lang>
 
=={{header|Java}}==
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.