Sierpinski triangle/Graphical: Difference between revisions
m
→{{header|J}}
m (→{{header|J}}) |
|||
Line 1,277:
'''Solution:'''
<lang j> load 'viewmat'
'rgb'viewmat--. |. (~:_1&|.)^:(<@#) (2^8){.1</lang>
This looks almost exactly (except for OS specific decorations) like the [[File:Sierpinski_Triangle_Unicon.PNG|task example image]]
Other approaches are possible
<lang j>load'viewmat
viewmat(,~,.~)^:4,1</lang> generates a [[j:File:Sier1.jpg|"smaller" image]] and is white on black instead of black on white.
Similarly, <lang J>viewmat #:(~:/&.#:@, +:)^:(<32) 1</lang> presents the [[j:File:Sierpinksi.png|image]] in a different orientation.
And, of course, other approaches are [[j:File:Triangle.png|viable]].
=={{header|Java}}==
|