Peano curve: Difference between revisions
Content deleted Content added
Add Ada |
|||
Line 528: | Line 528: | ||
=={{header|J}}== |
=={{header|J}}== |
||
This Hilbert variant is taken directly from the j lab "viewmat". |
This Hilbert variant is taken directly from the j lab "viewmat". |
||
< |
<lang j> |
||
load'viewmat' |
load'viewmat' |
||
hp=: 3 : '(|.,]) 1 (0 _2 _2 ,&.> _2 _1 0 + #y) } (,.|:) y' |
hp=: 3 : '(|.,]) 1 (0 _2 _2 ,&.> _2 _1 0 + #y) } (,.|:) y' |
||
Line 534: | Line 534: | ||
WR=: 16777215 16711680 |
WR=: 16777215 16711680 |
||
viewrgb WR {~ hp ^:7 HP |
viewrgb WR {~ hp ^:7 HP |
||
</ |
</lang 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}}== |
=={{header|Java}}== |