Jump to content

Sierpinski triangle/Graphical: Difference between revisions

m
Line 1,277:
'''Solution:'''
<lang j> load 'viewmat'
'rgb'viewmat--. |. (~:_1&|.)^:(<@#) (2^8){.1</lang>
</lang>
 
This looks almost exactly (except for OS specific decorations) like the [[File:Sierpinski_Triangle_Unicon.PNG|task example image]]
or
 
Other approaches are possible
<lang j>
 
load'viewmat'
<lang j>load'viewmat(,~,.~)^:8,1'
viewmat(,~,.~)^:4,1</lang> generates a [[j:File:Sier1.jpg|"smaller" image]] and is white on black instead of black on white.
</lang>
 
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}}==
6,962

edits

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