Closed athas closed 7 years ago
Here is one without nested arrays:
⎕←' #'[9>|m∘{⍺+⍵*2}⍣9⊢m←¯3×.7j.5-⍉a∘.+0j1×a←(⍳n+1)÷n←98]
And one that uses trains:
⎕←' #'[9>|m∘(2*⍨+)⍣9⊢m←¯3×.7j.5-⍉a∘.+0j1×a←(⍳n+1)÷n←98]
(Credit to @arcfide for these.)
Do we have a ⎕IO←1
version of this code?
No, but does it even do any array indexing?
it indexes into the character array ' #' and it uses iota. Fixing these quickly didn't work, though... Didn't spend a lot of time on this... ;)
The following version works now (test/mandel.apl):
⎕ ← ' #'[1+9>|({m+⍵×⍵}⍣9)(m←¯3×.7j.5-⍉a∘.+0j1×(a←(1+⍳n+1)÷(n←28)))]
Here is the result:
#
#
###
###
######## #
##########
###########
#### ###########
################
#################
#####################
#################
################
#### ###########
###########
##########
######## #
###
###
#
#
It also works with tail2futhark...
1+⍳n+1
I think that should be ¯1+⍳n+1
.
This one:
It needs complex numbers. Not sure what else.