Gerar um fractal mandelbrot [fechado]

51

Sua tarefa é desenhar o mandelbrot definido em ascii. Deve parecer algo como insira a descrição da imagem aqui

Os números complexos csitua-se no conjunto mandelbrot, quando a sequência z(n+1) = z(n)^2 + c, z(0) = 0restos delimitada. Para o objetivo deste desafio, você pode considerar a sequência delimitada por cif |z(32)| < 2.

Plote o conjunto de mandelbrot no plano complexo de (-2 - i) a (1 + i) e uma resolução mínima de 40x30, usando caracteres ascii no seu idioma favorito, usando o mínimo de caracteres possível.

Hannesh
fonte
33
Desde a especificação é um pouco mais claro no que diz respeito a esse ponto eu posso propor as seguintes baixa resolução ;-) solução php 1-char:*
Howard
3
Bem, eu esperava poder dizer "não seja idiota": D. Iremos com pelo menos 40x30 então.
Hannesh
3
Tenho uma preferência pessoal por tarefas que resolvem uma classe de problemas em vez de uma instância. Fazer a região usar uma entrada tornaria essas perguntas qualificadas. De qualquer forma, a especificação é um pouco leve. No futuro, você pode obter ajuda com esses tipos de problemas na caixa de areia meta ou o bate-papo quebra-cabeça laboratório antes de tarefa vai viver
dmckee
11
@ Hannesh, eu concordo com o dmckee. Se você mudar a pergunta, ficarei feliz em adicionar argumentos.
usar o seguinte comando
2
Aqui está um código-fonte no formato do conjunto mandelbrot, que gera o conjunto mandelbrot de alta resolução ( preshing.com/20110926/… ) - OT para esta pergunta, mas achei que as pessoas aqui gostariam.
DanBeale 01/10/19

Respostas:

53

Supondo que o código da máquina conta, escrevi um produto há algum tempo que gera um Mandelbrot colorido de 320x200 em 64 bytes - http://www.pouet.net/prod.php?which=53287

Captura de tela

Aqui está o código:

; "Microbrot" by Sir_Lagsalot

org 100h
mov al,13h
int 10h

les ax,[bx]

FillLoop:
cwd
mov ax,di
mov cx,320
div cx
sub ax,100
dec dh

xor bx,bx
xor si,si

MandelLoop:
mov bp,si
imul si,bx
add si,si
imul bx,bx
jo MandelBreak
imul bp,bp
jo MandelBreak
add bx,bp
jo MandelBreak
sub bx,bp
sub bx,bp

sar bx,6
add bx,dx
sar si,6
add si,ax

loop MandelLoop

MandelBreak:
xchg ax,cx
stosb
jmp FillLoop

Versão compilada em base64:

sBPNEMQHmYn4uUAB9/GD6GT+zjHbMfaJ9Q+v8wH2D6/bcBkPr+1wFAHrcBAp6ynrwfsGAdPB/gYBxuLbkarrxg==
Sir_Lagsalot
fonte
9
Eu li o código e pensei que era muito curto / simples de fazer qualquer coisa interessante. Dois minutos depois, sudo apt-get install dosbox; dosbox ./Microbrot.comfui encontrado pegando minha mandíbula no chão. Isso é bastante impressionante!
sehe
2
IMO, temos um vencedor.
Hauleth 15/01/12
2
Hmm, acho que você precisa passar a saída para um conversor ascii-art para que isso conte?
Paŭlo Ebermann
9
@ Hannesh Estou um pouco atrasado para a festa, mas você está ciente de que isso nem atende às especificações? (Representação ASCII?)
flawr 25/10/2015
11
-1! Ele não mostra a gama do pedido: "Traça-se a mandelbrot no plano complexo de (-2 - i) (1 + i)"
yeti
22

C, 988 caracteres

Aqui está o meu, que faz um mandelbrot ASCII, escrito como um mandelbrot ASCII, em C.

Ah .. e também possui a funcionalidade de zoom interativo. (pressione os números de teclado de 1 a 9 para ampliar a área respectiva)

int main(int argc, char* argv[]){ unsigned
char c='r';double x1,y,y1,t=0,q=78,r=22,x,
x2,y2,a,b,v;do{(c=='r')?(y2=-(y1=-1.6),x1=
-2.0f,x2=0.8):(c=='?')? c=0,   printf("%f\
,%f:%f,%f",x1,y1,x2,y2):(c     <':'&&c>48)
?x=x1,y=y1,*(c>'3'&&c<':'        ?&y1: &t)
+=(y2-y1)/3,*(c>'6'&&c<            ':'?&y1
:&t)+=(y2-y1)/3, *((c               == '8'
||c+3=='8'||c+3 +3==               '8'?&x1
:&t))+=(x2-x1     )/                3,*((c
=='9'||c+3==                        '9'||c
+6=='9'                          ?&x1: &t)
)+=2*(x2-x1)                        /3,x2=
x1+(x2-x)/3,      y2                 =y1+(
y2-y)/3:(c=0);for(y=                y2;y>=
y1&&c;c=1,y-=(y2-y1)/r,            putchar
('\n')) for(x=x1;x<=x2;            x+=(x2-
x1)/q){a=b=c=0; while  (        ++c&&(a=(t
=a)*a)<4&&(v=b*b)<4)a-=v-x     ,b=y+b*2*t;
putchar("#@XMW*N&KPBQYKG$R"   "STEEVxHOUV"
"CT()[]%JL={}eou?/\\|Ili+~<>_-^\"!;:`,. "[
c?c>>2:63]);}} while((c=getchar ())!='x');
return 0;/* Mandelbrot - S.Goodwin.2001*/}

Originalmente publicado aqui http://marquisdegeek.com/rnd_obs.php

Marquis de Geek
fonte
Agradável! Certifique-se de incluir um cabeçalho de idioma e contagem de bytes ao responder a perguntas sobre códigos de golfe. Bem-vindo ao PPCG!
Jonathan Van Matre
3
Você pode participar da IOCCC com este código
TuxCrafting
@ TùxCräftîñg: Não tão ofuscado ... Afinal, todo o espaço em branco é a documentação!
sergiol
18

Lisp comum - 195 caracteres

(loop for y from -1 to 1 by 1/15 do
  (loop for x from -2 to 1 by .04 do
    (let*((c 126) (z (complex x y)) (a z))
      (loop while (< (abs (setq z (+ (* z z) a))) 2)
            while (> (decf c) 32)) 
      (princ (code-char c))))
  (terpri))

Testado com sbcl e clisp. Resultado:

~~~~~~~~~~~~~}}}}}}}}}}}}}}}}}}}}||||||||{{{zyvrwum{|||||}}}}}}~~~~~~~~~~~~~
~~~~~~~~~~~}}}}}}}}}}}}}}}}}}}}|||||||||{{{zyxvptwyz{{|||||}}}}}}~~~~~~~~~~~
~~~~~~~~~}}}}}}}}}}}}}}}}}}}}|||||||||{{{{zwLtb huwx{{{{||||}}}}}}}~~~~~~~~~
~~~~~~~~}}}}}}}}}}}}}}}}}}}|||||||||{{zzzyxvn    Knwyz{{{{||||}}}}}}~~~~~~~~
~~~~~~~}}}}}}}}}}}}}}}}}}||||||||{{zzzzyyywuk     qwxyzzzz{{|||}}}}}}~~~~~~~
~~~~~}}}}}}}}}}}}}}}}}}|||||||{{{zxjnpwwtjsqpi   lqrujnxyyxrz{|}}}}}}}}~~~~~
~~~~}}}}}}}}}}}}}}}}}|||||{{{{{zzzxt>  qf             pttfqeqz{|}}}}}}}}~~~~
~~~~}}}}}}}}}}}}}}}|||{{{{{{{{zzzxwup                      sxz{||}}}}}}}~~~~
~~~}}}}}}}}}}}}|||{z{{{{{{{zzzzywkmo                      rwyz{{||}}}}}}}~~~
~~}}}}}}}}}||||{{zwvyyyyyyyyyyyxvsP                        swvz{||}}}}}}}}~~
~~}}}}|||||||{{{zzwrtsww^uwwxxwvr                            iz{|||}}}}}}}~~
~}}}|||||||{{{{{zyxws  mj Ubhuutl                           sxz{|||}}}}}}}}~
~}||||||||{{{{{zyytun         qq                            avz{|||}}}}}}}}~
~|||||||{{zzzyxsvvum           j                            Sz{{|||}}}}}}}}~
~{{{{{yyzzzyyxwtbUP                                        qyz{{||||}}}}}}}~
~                                                        pvxyz{{||||}}}}}}}}
~{{{{{yyzzzyyxwtbUP                                        qyz{{||||}}}}}}}~
~|||||||{{zzzyxsvvum           j                            Sz{{|||}}}}}}}}~
~}||||||||{{{{{zyytun         qq                            avz{|||}}}}}}}}~
~}}}|||||||{{{{{zyxws  mj Ubhuutl                           sxz{|||}}}}}}}}~
~~}}}}|||||||{{{zzwrtsww^uwwxxwvr                            iz{|||}}}}}}}~~
~~}}}}}}}}}||||{{zwvyyyyyyyyyyyxvsP                        swvz{||}}}}}}}}~~
~~~}}}}}}}}}}}}|||{z{{{{{{{zzzzywkmo                      rwyz{{||}}}}}}}~~~
~~~~}}}}}}}}}}}}}}}|||{{{{{{{{zzzxwup                      sxz{||}}}}}}}~~~~
~~~~}}}}}}}}}}}}}}}}}|||||{{{{{zzzxt>  qf             pttfqeqz{|}}}}}}}}~~~~
~~~~~}}}}}}}}}}}}}}}}}}|||||||{{{zxjnpwwtjsqpi   lqrujnxyyxrz{|}}}}}}}}~~~~~
~~~~~~~}}}}}}}}}}}}}}}}}}||||||||{{zzzzyyywuk     qwxyzzzz{{|||}}}}}}~~~~~~~
~~~~~~~~}}}}}}}}}}}}}}}}}}}|||||||||{{zzzyxvn    Knwyz{{{{||||}}}}}}~~~~~~~~
~~~~~~~~~}}}}}}}}}}}}}}}}}}}}|||||||||{{{{zwLtb huwx{{{{||||}}}}}}}~~~~~~~~~
~~~~~~~~~~~}}}}}}}}}}}}}}}}}}}}|||||||||{{{zyxvptwyz{{|||||}}}}}}~~~~~~~~~~~
~~~~~~~~~~~~~}}}}}}}}}}}}}}}}}}}}||||||||{{{zyvrwum{|||||}}}}}}~~~~~~~~~~~~~

Ligeiramente modificado do blog B. Clementson .

stackman
fonte
Isso é código de golfe. Não conte recuo se não for necessário.
JB
@ JB. Eu atualizei a contagem de caracteres. Não leva mais em conta espaços supérfluos. Eu deixei o código recuado para facilitar a leitura. Também ajustei um parâmetro, a imagem agora segue a especificação de tamanho.
stackman 29/09/11
Muito melhor. Votado.
JB
11

Python, 146 145 143char

z=lambda x,c,n:z(x**2+c,c,n-1)if n*(abs(x)<2)else x
for y in range(-15,16):print''.join(' @'[abs(z(0,x/25.+y/15j,32))<2]for x in range(-50,26))

Foi necessário adicionar a cláusula (abs (x) <2) à expressão condicional para impedir que o Python voasse sobre os estouros. Mas ... essa é uma razão pela qual eu amo Sage ...

Sábio, 133char

z=lambda x,c,n:z(x^2+c,c,n-1)if n else abs(x)<2
for y in range(-15,16):
 print''.join(' +'[z(0,x/25+y/15j,32)]for x in range(-50,26))

Saída de amostra (da versão python)

                                                  @                         

                                            @  @                            
                                             @@@@@                          
                                             @@@@@                          
                                              @@@                           
                                    @@@  @@@@@@@@@@@@@                      
                                     @@@@@@@@@@@@@@@@@@@@@@                 
                                    @@@@@@@@@@@@@@@@@@@@@@                  
                                  @@@@@@@@@@@@@@@@@@@@@@@@@                 
                        @        @@@@@@@@@@@@@@@@@@@@@@@@@@@@               
                     @@  @@      @@@@@@@@@@@@@@@@@@@@@@@@@@@                
                     @@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@                
                    @@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@               
                 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                   
                 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                 
                    @@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@               
                     @@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@                
                     @@  @@      @@@@@@@@@@@@@@@@@@@@@@@@@@@                
                        @        @@@@@@@@@@@@@@@@@@@@@@@@@@@@               
                                  @@@@@@@@@@@@@@@@@@@@@@@@@                 
                                    @@@@@@@@@@@@@@@@@@@@@@                  
                                     @@@@@@@@@@@@@@@@@@@@@@                 
                                    @@@  @@@@@@@@@@@@@                      
                                              @@@                           
                                             @@@@@                          
                                             @@@@@                          
                                            @  @                            

                                                  @                         
boothby
fonte
Eu acho que você pode apenas usar 15jna versão python também
gnibbler
Para barbear um caractere, adicione uma linha r=range(-50,26). Substitua range(-15,16)por r[35:66]e substitua range(-50,26)por r.
Steven Rumbalski
10

J , 61 caracteres

{&' *'(2:>[:|([+]*])^:32 ::_:)&0"0(j.1-16%~i.33)+/_2+32%~i.97
                                                                *                                

                                                            **                                   
                                                         ****** *                                
                                                         ********                                
                                                          *****                                  
                                                    *************** *                            
                                               *********************** ***                      
                                           * ****************************                      
                                           ********************************                      
                                           ********************************* *                  
                                          ************************************                   
                           ** ****** ************************************                    
                          ************* **************************************                    
                         *************** *************************************                     
                     **************************************************** ****                      
 **************************************************** **********************                        
                     **************************************************** ****                      
                         *************** *************************************                     
                          ************* **************************************                    
                           ** ****** ************************************                    
                                          ************************************                   
                                           ********************************* *                  
                                           ********************************                      
                                           * ****************************                      
                                               *********************** ***                      
                                                    *************** *                            
                                                          *****                                  
                                                         ********                                
                                                         ****** *                                
                                                            **                                   

                                                                *                                

55 para 0/1 separado por espaço em vez de estrelas.

(2:>[:|([+]*])^:32 ::_:)&0"0(j.1-16%~i.33)+/_2+16%~i.49
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
efémero
fonte
8
Oh Deus, meus olhos ...
gobernador
10

BASH - 167 165 148

O mb3arquivo:

eval g={-4096..4096..199}'
'h={-8192..4096..99}'
x=;y=;for((i=0;i<30&&x*x+y*y<1<<26;i++)){((v=(x*x-y*y>>12)+h,y=(x*y>>11)+g,x=v));}
printf $[i%10]
'

(sem nova linha à direita)

Execute-o em um terminal com comprimento de linha 125:

saída mb3


BASH - 214 190

for h in {-4096..4096..200};do
for g in {-8192..4096..115};do
x=0;y=0
for((i=0;i<30&&x*x+y*y<1<<26;i++));do((v=((x*x-y*y)>>12)+g));((y=((x*y)>>11)+h))
x=$v
done;printf $[i%10];done;echo;done

Basicamente, é o mesmo código abaixo, com os cálculos sendo substituídos por valores codificados e a imagem foi alterada em torno do eixo x.

Instantâneo de execução mb2.bash

A versão abaixo não se encaixava totalmente nas regras que quebram "de (-2 - i) a (1 + i)".


BASH - 263 261 260 236

Use esta fonte, Luke:

a=-8601;b=2867;c=-4915;d=4915
((e=(b-a)/99));((f=(d-c)/49))
for((h=d;h>=c;h-=f));do
for((g=a;g<=b;g+=e));do
x=0;y=0
for((i=0;i<30&&x*x+y*y<1<<26;i++));do((v=((x*x-y*y)>>12)+g))
((y=((x*y)>>11)+h));x=$v
done
printf $[i%10]
done;echo;done

Esse código usa apenas aritmética inteira, portanto, o BASH não precisa de ajudantes adicionais para fazer matemática de ponto flutuante ...

Instantâneo de execução mb.bash

yeti
fonte
Nas avaliações aritméticas, o Bash converte as cadeias vazias para 0, o que é suficiente para inicializar x=;y=. Os operadores de turno têm menor precedência do que adição e multiplicação, portanto, não há necessidade de parênteses ao redor >>do operando do lado esquerdo. E você pode usar {... em }vez de do... done, como recomenda o Digital Trauma em sua dica . E você pode colocar várias expressões em uma avaliação aritmética, basta separá-las com ,.
manatwork
@manatwork ... obrigado! ;-)
yeti
Você esqueceu um par de parênteses (x*x-y*y)>>12. Eles não mudam nada.
manatwork
Sim ... parece muuuito média sem o parêntese ... eu meio que não se atreveu a isso ...: - /
yeti
6

Ruby, 95 caracteres

puts (-20..20).map{|y|(-40..20).map{|x|z=0;32.times{z=z*z+Complex(x,y)/2e1};z.abs<2??*:' '}*''}

Saída de amostra:

                                        *                    

                                     *                       
                                   * *                      
                                    ****                     
                                    *****                    
                                    ****                     
                             * * ****** * *                 
                             ** **********                  
                             ******************              
                             ******************              
                           * ******************              
                            *******************              
                          ***********************            
                    * *********************             
                 * *** **********************             
                 ******* **********************             
                ********* **********************             
                ********************************             
             **********************************              
 *********************************************               
             **********************************              
                ********************************             
                ********* **********************             
                 ******* **********************             
                 * *** **********************             
                    * *********************             
                          ***********************            
                            *******************              
                           * ******************              
                             ******************              
                             ******************              
                             ** **********                  
                             * * ****** * *                 
                                    ****                     
                                    *****                    
                                    ****                     
                                   * *                      
                                     *                       

                                        *                    
Howard
fonte
6

Haskell, 130

import Complex
main=mapM_ putStrLn[[" *"!!fromEnum(magnitude(iterate((+(x:+y)).(^2))0!!32)<2)|x<-[-2,-1.95..1]]|y<-[-1,-0.95..1]]

Resultado:

                                        *                    

                                     *                       
                                   *  *                      
                                    ****                     
                                    *****                    
                                    ****                     
                             *  * ****** * *                 
                             **  **********                  
                             ******************              
                             ******************              
                           * ******************              
                            *******************              
                          ***********************            
                    *      *********************             
                 * ***    **********************             
                 *******  **********************             
                ********* **********************             
                ********************************             
             **********************************              
 *********************************************               
             **********************************              
                ********************************             
                ********* **********************             
                 *******  **********************             
                 * ***    **********************             
                    *      *********************             
                          ***********************            
                            *******************              
                           * ******************              
                             ******************              
                             ******************              
                             **  **********                  
                             *  * ****** * *                 
                                    ****                     
                                    *****                    
                                    ****                     
                                   *  *                      
                                     *                       

                                        *          
hammar
fonte
Acima da minha cabeça está cheia de estrela ******
Jamie
6

Aqui está uma resposta de script de café em execução no node.js: em preto e branco:

m=(x,y)->
 a=x
 b=y
 z=0
 for i in [0..99]
  (return if i>60 then '*' else if i>10 then '-' else if i>5 then '.' else ' ') if z>4
  l=y*y
  z=x*x+l
  y=2*x*y+b
  x=x*x-l+a
 '@'
console.log (m x,y for x in [-1.5..0.5] by 2/79).join '' for y in [-1.3..1.3] by 2.6/40

ascii_mandel_color

Adicionando cor:

n='\u001b[0m'
m=(x,y)->
 a=x
 b=y
 z=0
 for i in [0..999]
  (return if i>100 then '\u001b[33m*'+n else if i>10 then '\u001b[34m-'+n else if i>5 then '\u001b[31m.'+n else ' ') if z>4
  l=y*y
  z=x*x+l
  y=2*x*y+b
  x=x*x-l+a
 '\u001b[32m@\u001b[0m'
console.log (m x,y for x in [-1.5..0.5] by 2/79).join '' for y in [-1.3..1.3] by 2.6/40
agent-j
fonte
Você sabe que olhar verde é bom para os seus olhos?
Jamie
6

Mathematica 56

RegionPlot[Abs@Nest[#^2+x+I*y&,0,9]<2,{x,-2,1},{y,-1,1}]

Mathematica 77

ArrayPlot[2^-Abs@Nest[#^2+Table[j+i*I,{i,-1.2,1.2,.1},{j,-1.8,0.6,.1}]&,0,6]]

insira a descrição da imagem aqui

Mathematica 77

Grid@Table[If[Abs@Nest[#^2+y+x*I&,0,30]<2,"*",""],{x,1,-1,-.1},{y,-2,0.5,.1}]

insira a descrição da imagem aqui

chyanog
fonte
Agradável. Eu tentei essa abordagem: GraphicsGrid@ImageData@Binarize@MandelbrotSetPlot[ImageResolution->40]/.{1->" ",0->"*"}mas eram 84 caracteres e a saída não é tão boa quanto a sua de qualquer maneira.
Michael Stern
5

Perl, 153 caracteres

for(-21..20){$y=$_/20;for(-60..18){$r=($x=$_/30);$i=$y;for(1..99){$t=$r;$r=$r**2-$i**2+$x;$i=$t*$i*2+$y}if($r**2+$i**2<4){print"X"}else{print$"}}print$/}

Saída: Não consigo postar uma foto porque sou um novo usuário, por isso tentarei postar o texto da saída.

                                                            X                  


                                                        XX                     
                                                      XXXXXX                   
                                                     XXXXXXX                   
                                                      XXXXX                    
                                                   X X XX X                    
                                            XX   XXXXXXXXXXXXXXXX              
                                            XXXXXXXXXXXXXXXXXXXXXXXXXX         
                                            XXXXXXXXXXXXXXXXXXXXXXXXXX         
                                          X XXXXXXXXXXXXXXXXXXXXXXXXXX          
                                          XXXXXXXXXXXXXXXXXXXXXXXXXXXXX        
                                       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX      
                                        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX        
                          X XXXX       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       
                          XXXXXXXXX    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       
                        XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       
                        XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX        
                    XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX        
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX           
                    XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX        
                        XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX        
                        XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       
                          XXXXXXXXX    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       
                          X XXXX       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       
                                        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX        
                                       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX      
                                          XXXXXXXXXXXXXXXXXXXXXXXXXXXXX        
                                         X XXXXXXXXXXXXXXXXXXXXXXXXXX          
                                            XXXXXXXXXXXXXXXXXXXXXXXXXX         
                                            XXXXXXXXXXXXXXXXXXXXXXXXXX         
                                            XX   XXXXXXXXXXXXXXXX              
                                                   X X XX X                    
                                                      XXXXX                    
                                                     XXXXXXX                   
                                                      XXXXXX                   
                                                        XX                     


                                                            X                  
PhiNotPi
fonte
4

C # - 304 caracteres

Quando codifico, codifico com legibilidade e formatação bonita. Eu vomitei escrevendo isso.

using C=System.Console;class Program{static void Main()
{C.WindowWidth=220;C.WindowHeight=80;
int w=220,h=80,m=100;double s=4.0/w,v=4.0/h;
for(int i=0;i<h;i++)for(int j=0;j<w;j++){
double n=s*j-2,u=v*i-2,x=0,y=0;int r=0;
for(r=0;x*x+y*y<4&&r<m;r++){
double t=x*x-y*y+n;y=2*x*y+u;x=t;}
C.Write(r>=m?'#':' ');}C.ReadLine();}}

Estou certo de que minha solução pode ser melhorada, mas como referência, eu a publicarei. Observe que o console do Windows esmaga a imagem.

insira a descrição da imagem aqui

Ali Caglayan
fonte
11
Parece um bug!
Hosch250
3

Haskell: 340 char

Bem, como não vejo resposta haskell, posto a minha, tentei minimizá-la do que fiz até agora. Tenho certeza de que posso reduzi-lo bastante. Mas aqui está a primeira tentativa:

m (x,y) (z,t)=(z*x-y*t,y*z+x*t);
a (x,y) (z,t)=(x+z,y+t);
r=1.0
f c z 0=z
f c z n=f c (a (m z z) c) (n-1)
e (x,y)=sqrt(x*x+y*y)
t c=(e(f c (0.0,0.0) 32)) < 2
b=map (\z -> (t z, (fst z > r-0.01))) [(x,y) | y <- [-r,-r+(1.0/15)..r], x<-[-2*r,-1.96..r]]
s True="\n"
s _=""
g (b,c)=(if (b) then "@" else " ")++s c
main=putStrLn$concat$map g b

E aqui está o resultado:

                                                  @                         

                                            @  @                            
                                             @@@@@                          
                                             @@@@@                          
                                              @@@                           
                                    @@@  @@@@@@@@@@@@@                      
                                     @@@@@@@@@@@@@@@@@@@@@@                 
                                    @@@@@@@@@@@@@@@@@@@@@@                  
                                  @@@@@@@@@@@@@@@@@@@@@@@@@                 
                        @        @@@@@@@@@@@@@@@@@@@@@@@@@@@@               
                     @@  @@      @@@@@@@@@@@@@@@@@@@@@@@@@@@                
                     @@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@                
                    @@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@               
                 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                   
                 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                 
                    @@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@               
                     @@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@                
                     @@  @@      @@@@@@@@@@@@@@@@@@@@@@@@@@@                
                        @        @@@@@@@@@@@@@@@@@@@@@@@@@@@@               
                                  @@@@@@@@@@@@@@@@@@@@@@@@@                 
                                    @@@@@@@@@@@@@@@@@@@@@@                  
                                     @@@@@@@@@@@@@@@@@@@@@@                 
                                    @@@  @@@@@@@@@@@@@                      
                                              @@@                           
                                             @@@@@                          
                                             @@@@@                          
                                            @  @                            

                                                  @                         

OK - Inspirado por algum código C ofuscado e animado no HN, aqui está uma versão animada:

a=27;b=79;c=C(-2.0,-1.0);d=C(1.0,1.0);e=C(-2.501,-1.003)
newtype C = C (Double,Double) deriving (Show,Eq)
instance Num C where C(x,y)*C(z,t)=C(z*x-y*t,y*z+x*t);C(x,y)+C(z,t)=C(x+z,y+t);abs(C(x,y))=C(sqrt(x*x+y*y),0.0)
r(C(x,y))=x;i(C(x,y))=y
f :: C -> C -> Int -> Int
f c z 0=0;f c z n=if(r(abs(z))>2)then n else f c ((z*z)+c) (n-1)
h j k = map (\z->(f (C z) (C(0,0)) 32,(fst z>l - q/2))) [(x,y)|y<-[p,(p+((o-p)/a))..o],x<-[m,(m + q)..l]] where o=i k;p=i j;m=r j;l=r k;q=(l-m)/b
u j k = concat $ map v $ h j k where v (i,p)=(" .,`'°\":;-+oO0123456789=!%*§&$@#"!!i):rst p;rst True="\n";rst False=""
main = putStrLn $ im 0 where cl n (C (x,y))=let cs=(1.1**n-1) in C ((x+cs*(r e))/cs+1,(y+cs*(i e))/cs+1);bl n=cl n c;tr n=cl n d;im n=u (bl n) (tr n)++"\x1b[H\x1b[25A"++im (n+1)

Copie / cole, faça um runghc mandel.hs, divirta-se!

Aqui está o tipo de resultado após 50 iterações:

77777777777777777777777777777777777777777777777666666666666666666666666666666666
77777777777777777777777777777777777777777766665555555555566666666666666666666666                                                                                                     
666777777777777777777777777777666666666665543;4445555555555555555555666666666555
66666666666666666666666666666666666666555554300334555555555555555555555555555555 
6666666666666666666666666666666666665555554431:°33345555555555555555555555555544
5566666666666666666666666666666666555555554321 ;00O:3455555555555555555444444444
5555666666666666666666666666666655555555554O+++ :o022334444444444444444444444444
5555556666666666666666666666665555555555543210O-+O112333344444444444444444444444
55555555666666666666666666665555555555444333210o`O012333333444444444444444444444
4555555555566666666666666555555555544444333331O+°°,'0233333334444444444444444433
44444445555555556666555555555444444444433333210o-:O01122333333334444444444443333
44444444444444445555444444444444444444333332211O+ -o1112222223333333344433333222
444444444444433331133334444444444444433332221110o"+O0111222222222222222222222222  
34444444443333330OO03333334444444443332222221100O+-oO001122222222221110-O1111122
22333333333332210--01223333333333322222222211000o-°+o00000122222111110o°;o001111
11OO112222222111O;;O111222222211OO111122211000Oo-" :+ooOOOO.O0000000OOo'°oOO0000
0O;+O01122211000O--O00011221110O+;O00000OO +oooo-: :-+oo++";oOO0000Ooo+;;+oooO00
o+"+oO00OO OOOOoo::ooOOOO°OO00Oo+"+ooOooo+;°---",' ,,";--: ;-+oo+ +++;;°°;;-++:;
,° °':°: ` "`".°°  °° "°".  :'",  '°`°":`°` ,,``     .   . .°°'°° ` ..     `'°. 
+-`-oo+oo+'+o+`--°°;-`+o+"+oo+oo-'-++;+++-:,:::"`    °::°° :-;;--,;-; "  " ;-;":
OO"-O0000000000Oo--oO0000000000O-:oO0000Oo::+++;;: ":"-++-';+oooOOoooo-::-oooo++
10;-111222222110O--O011222222111- 01111110oOOOoo-: :-ooooo`:OO000000OO+;;+OOO000
22122222222222110++0112222222222111222222221000O+:,;.O000001111111100Oo:-OO00000
3344444433333332-,°-2333333344444433322222221100o-;oO00011222222221111O'+0111111
444444444444333320023333444444444444433322221110O.:O0011222222222222211-01112222
44444444444444443333444444444444444444333332211O. -o1112222222223333333333322222
44444444445555555555555555444444444444433333210O-"oO1122223333333444444444433333
444555555555666666666666555555555444444433333' '`:+O0233333333444444444444444433

E um link para um código mais legível:

http://yannesposito.com/Scratch/en/blog/Haskell-Mandelbrot/

yogsototh
fonte
3

J, 70

3 :'try.2>|(y&+&*:)^:32[0 catch.0 end.'"0(1-~15%~i.31)j.~/2-~13%~i.40

Exibe os membros do conjunto como 1, o restante como 0. Espaça cada ponto calculado com dois caracteres de largura, para manter um pixel principalmente quadrado com a maioria das fontes.

JB
fonte
3

QBasic, 222 caracteres. Não é tão curto, mas o QBasic é uma linguagem bastante detalhada. Também atualizei com uma versão aparentemente mais correta

FOR y=1 TO 23
FOR x=1 TO 80
a=0:b=0
c=-2.5+(x/80)*3.5:d=-1+(y/23)*2
FOR i=0 TO 1000
IF a*a+b*b>=4 THEN GOTO E
t=a*a-b*b*c:b=2*a*b+d:a=t
NEXT
E:LOCATE y,x
IF a*a+b*b<4 THEN
?("@")
ELSE
?(" ")
END IF
NEXT
NEXT

A saída é como na imagem a seguir.

insira a descrição da imagem aqui

Kibbee
fonte
2

SpecBAS 201

Sei que essa é uma pergunta antiga, mas estamos brincando com o ascii brot de Perlin no fórum de programação do BASIC, e aqui está o meu - no SpecBAS (que é um tipo de intérprete do Sinclair BASIC) e é realmente apenas texto, e um linha de código:

1FOR y=-29TO 30:FOR x=-10TO 89:LET m,r=0:FOR k=0TO 224:LET j=r^2-m^2-2+x/25,m=2*r*m+y/25,r=j,l=k,k=IIF(j^2+m^2>11,225,k):NEXT k:PRINT INK l;"ð";:NEXT x:NEXT y

Resultado: SpecBAS ascii mandelbrot

ZXDunny
fonte
A saída deve estar em ASCII. (E você pode escrever por exemplo, qualquer programa Java em uma linha.)
flawr
A entrada com o voto mais alto não foi ASCII.
ZXDunny 26/10
@flawr Ok, aqui está a versão "ascii" (176 bytes) - ea razão pela qual eu estava bastante contente com isso sendo uma única linha é que ele não é realmente Java ... 1FOR y=-29TO 30:FOR x=-10TO 89:LET m,r=0:FOR k=0TO 112:LET j=r^2-m^2-2+x/25,m=2*r*m+y/25,r=j,l=k&15,k=IIF(j^2+m^2>11,113,k):NEXT k:PRINT" .:-;!/>)|&IH%*#"(l+1);:NEXT x:NEXT y.
ZXDunny
Você deve colocar essa versão na resposta.
CalculatorFeline
1

Perl - 193 caracteres

$Y=-1.2;for(0..24){$X=-2;for(0..79){($r,$i)=(0,0);for(0..15){$n=$_;$r=($x=$ r)*$x-($y=$i)*$y+$X;$i=2*$x*$y+$Y;$x*$x+$y*$y>4&&last}print unpack("\@$n a" ,".,:;=+itIYVXRBM ");$X+=3/80}$Y+=2.4/25}

Resultado

,,,,,,,,,,,::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::::::::::::::::::::
,,,,,,,,,:::::::::;;;;;;;;;;;;;;;;;;;;;;======+iRV+++====;;;;;;:::::::::::::::::
,,,,,,,,::::::;;;;;;;;;;;;;;;;;;;;;;========+++itVXYYRi======;;;;;;:::::::::::::
,,,,,,:::::;;;;;;;;;;;;;;;;;;;;;;=========++++ttIR  VIt+++=====;;;;;;;::::::::::
,,,,,::::;;;;;;;;;;;;;;;;;;;;==========+++iitIX        ti++++====;;;;;;;::::::::
,,,,:::;;;;;;;;;;;;;;;;;;;=========++ittttttIYX       VIItiiiii++==;;;;;;;::::::
,,,::;;;;;;;;;;;;;;;;;;======+++++iit     R               RY XX Y++=;;;;;;;;::::
,,::;;;;;;;;;;;;;;;;===+++++++++iiitIVB                        Mti++=;;;;;;;;:::
,,:;;;;;;;;;;;====+XtiiiiiiiiiittIYM                           RIti+==;;;;;;;;::
,:;;;;;=======+++iiI XVVYV VYYIIYYB                               t+===;;;;;;;;:
,;;========++++++ttIY          MRB                               Mi+===;;;;;;;;;
,========+++iiiIRYYX                                             t++====;;;;;;;;
,++iitYttttIIIVXM                                              Yti++====;;;;;;;;
,++iitYttttIIIVXM                                              Yti++====;;;;;;;;
,========+++iiiIRYYX                                             t++====;;;;;;;;
,;;========++++++ttIY          MRB                               Mi+===;;;;;;;;;
,:;;;;;=======+++iiI XVVYV VYYIIYYB                               t+===;;;;;;;;:
,,:;;;;;;;;;;;====+XtiiiiiiiiiittIYM                           RIti+==;;;;;;;;::
,,::;;;;;;;;;;;;;;;;===+++++++++iiitIVB                        Mti++=;;;;;;;;:::
,,,::;;;;;;;;;;;;;;;;;;======+++++iit     R               RY XX Y++=;;;;;;;;::::
,,,,:::;;;;;;;;;;;;;;;;;;;=========++ittttttIYX       VIItiiiii++==;;;;;;;::::::
,,,,,::::;;;;;;;;;;;;;;;;;;;;==========+++iitIX        ti++++====;;;;;;;::::::::
,,,,,,:::::;;;;;;;;;;;;;;;;;;;;;;=========++++ttIR  VIt+++=====;;;;;;;::::::::::
,,,,,,,,::::::;;;;;;;;;;;;;;;;;;;;;;========+++itVXYYRi======;;;;;;:::::::::::::
,,,,,,,,,:::::::::;;;;;;;;;;;;;;;;;;;;;;======+iRV+++====;;;;;;:::::::::::::::::

Eu acho que venceu o concurso ofuscado perl há alguns anos atrás.

stackman
fonte
11
Então não é seu? Pode ser bom dizer de quem é.
Camilo Martin
1

Python, 115.

r=range
for _ in r(-11,12):
 for f in r(-39,41):
  v=u=f/22.-_/11j;exec"u=u*u+v;"*40;print"\b"+chr(32+(u.real<4)),

Funciona apenas em terminais 80x24, mas você pode adicionar printdepois forpara corrigi-lo.

Saída de amostra (com printinstruções adicionais .):

                                       !                                        

                                   !!!                                          
                                  !!!!!                                         
                            !  ! !!!!!!!! !                                     
                           !!!!!!!!!!!!!!!!! !!                                 
                        ! !!!!!!!!!!!!!!!!!!!!!                                 
                        !!!!!!!!!!!!!!!!!!!!!!!                                 
              !  !      !!!!!!!!!!!!!!!!!!!!!!!!                                
            !!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!                                
            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                   
            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                 
            !!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!                                
              !  !      !!!!!!!!!!!!!!!!!!!!!!!!                                
                        !!!!!!!!!!!!!!!!!!!!!!!                                 
                        ! !!!!!!!!!!!!!!!!!!!!!                                 
                           !!!!!!!!!!!!!!!!! !!                                 
                            !  ! !!!!!!!! !                                     
                                  !!!!!                                         
                                   !!!                                          

                                       !                                        
iniciar
fonte
1

c ++ - 11 - 298 caracteres

Versão totalmente não-parametrizada e totalmente adaptada ao golfe, que faz apenas o necessário:

#include <complex>
#include <iostream>
#define C complex<float>
using namespace std;int main(void){C p(-2,1),q(1,-1);char i,j,k;
for(j=0;j<30;++j){for(i=0;i<80;++i){C r=q-p,c((i+0.5)*r.real()/
81+p.real(),(j+0.5)*r.imag()/31+p.imag());r=0;k=64;while
(abs(r)<=2&&(--k!=32))r=r*r+c;cout<<k;}cout<<endl;}}

A implementação é completamente normal. Apenas vendo o que pode ser feito usando o tempo complexo nativo (que é, infelizmente, um pouco prolixo).

Ungolfed e parametrizado para que ele possa fazer regiões

#include <complex>
#include <iostream>
using namespace std;
void M/*andlebrot*/(ostream& o, 
            complex<float> p, complex<float> q, 
            int l, int h) {
  char i,j,k;
  for(j=0; j<h; ++j){
    for(i=0; i<l; ++i){
      complex<float> r=q-p,c((i+0.5)*r.real()/(l+1)+p.real(), 
                 (j+0.5)*r.imag()/(h+1)+p.imag() );
      r=0;
      k='@';
      while(abs(r)<=2&&(--k!=' ')){
        r=r*r+c;
      }
      o<<k;
    }
    o<<endl;
  }
}

int main(int argc, char*argv[]){
  M(cout,complex<float>(-2.15,1.25),complex<float>(0.65,-1.25),80,30);
}

Resultado

$ g++-fsf-4.7  mandelbrot_golf.cc --std=c++11
$ ./a.out
???????>>>>>>=====================<<<<<<<<<;;;;:974048:;<<<<<<======>>>>>>>>>>>>
??????>>>>>=====================<<<<<<<<<<;;;:9872  '89:;;<<<<<<======>>>>>>>>>>
?????>>>>=====================<<<<<<<<<<;;;::8$ /#  &349:;;;;<<<<=======>>>>>>>>
????>>>=====================<<<<<<<<<;;::::9986-     *589::;;;;<<<========>>>>>>
????>>====================<<<<<<<<;;;9988998775/      57889::::9;<<========>>>>>
???>>===================<<<<<<;;;;;:96$.355 &()         2$28887,8:;<========>>>>
??>>==================<<<<;;;;;;;::987.                    2$   )9;<<========>>>
??>================<<<;;;;;;;;;::::8753+                       '8:;;<<========>>
?>=============<<<;::::;;;;;::::997                            589:;<<=========>
?>========<<<<<;;;:85899987999998861%                           (54;<<<========>
?=====<<<<<<<;;;;::8 03564&46677763!                             28:<<<=========
>==<<<<<<<<;;;;;::9873  ,   '  554#                              69;<<<<========
==<<<<<<<<;;;;;:998$3,          00                              -3:;<<<<========
=<<<<<<<;;::::975654)            )                              ,9:;<<<<========
<;;;::99:::999762  #                                            9:;;<<<<========
                                                             /589:;;<<<<========
<;;;::99:::999762  #                                            9:;;<<<<========
=<<<<<<<;;::::975654)            )                              ,9:;<<<<========
==<<<<<<<<;;;;;:998$3,          00                              -3:;<<<<========
>==<<<<<<<<;;;;;::9873  ,   '  554#                              69;<<<<========
?=====<<<<<<<;;;;::8 03564&46677763!                             28:<<<=========
?>========<<<<<;;;:85899987999998861%                           (54;<<<========>
?>=============<<<;::::;;;;;::::997                            589:;<<=========>
??>================<<<;;;;;;;;;::::8753+                       '8:;;<<========>>
??>>==================<<<<;;;;;;;::987.                    2$   )9;<<========>>>
???>>===================<<<<<<;;;;;:96$.355 &()         2$28887,8:;<========>>>>
????>>====================<<<<<<<<;;;9988998775/      57889::::9;<<========>>>>>
????>>>=====================<<<<<<<<<;;::::9986-     *589::;;;;<<<========>>>>>>
?????>>>>=====================<<<<<<<<<<;;;::8$ /#  &349:;;;;<<<<=======>>>>>>>>
??????>>>>>=====================<<<<<<<<<<;;;:9872  '89:;;<<<<<<======>>>>>>>>>>
dmckee
fonte
Os parênteses no meio adicionar um toque agradável :)
Camilo Martin
Eu gostaria de poder afirmar que planejei, mas aconteceu. Defino a seleção de caracteres para permitir a maior variedade de impressões.
dmckee
1

GolfScript - 77

20{40{0.1{.{;..*2$.*\- 20/3$-@@*10/3$-..*2$.*+1600<}*}32*\;\;@@(}60*;(n\}40*;

Provavelmente pode ser jogado muito mais. O resultado é uma aproximação, porque eu tenho que usar números inteiros.

Resultado:

000000000000000000000000000000000000000010000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000001000000000000000000000000
000000000000000000000000000000000000001000000000000000000000
000000000000000000000000000000000000111000000000000000000000
000000000000000000000000000000000000111110000000000000000000
000000000000000000000000000000000000011100000000000000000000
000000000000000000000000000001000110111100010000000000000000
000000000000000000000000000000100111111111110000000000000000
000000000000000000000000000001011111111111110111000000000000
000000000000000000000000000001111111111111111110000000000000
000000000000000000000000000000111111111111111110000000000000
000000000000001000000000000011111111111111111111000000000000
000000000000000000000000000011111111111111111111000000000000
000000000000000000000000000111111111111111111111000000000000
000000000000000000000000001111111111111111111111100000000000
000000000000000001111110001111111111111111111111100000000000
000000000000000011111111101111111111111111111111100000000000
000000000000100111111111111111111111111111111111000000000000
000000000001101111111111111111111111111111111111000000000000
011111111111111111111111111111111111111111111100000000000000
000000000000001111111111111111111111111111111110000000000000
000000000000000111111111111111111111111111111111000000000000
000000000000000001111111111111111111111111111111100000000000
000000000000000001111111101111111111111111111111000000000000
000000000000000001011100000111111111111111111111100000000000
000000000000000000000100000111111111111111111111000000000000
000000000000000100000000001111111111111111111111100000000000
000000000000000100000000000011111111111111111111000000000000
000000000000000000000000000011111111111111111110000000000000
000000000000000000000000000001111111111111111111000000000000
000000000000000000000000000000111111111111111111000000000000
000000000000000000000000000001101111111111111000000000000000
000000000000000000000000000011000011111110100000000000000000
000000000000000000000000000000000000111100000000000000000000
000000000000000000000000000000000000111110000000000000000000
000000000000000000000000000000000000111100000000000000000000
000000000000000000000000000000000000011000000000000000000000
000000000000000000000000000000000000001000000000000000000000
000000000000000000000000000000000000000000000000000000000000

São necessários mais 9 bytes para fazer uso de espaços e estrelas:

20{40{0.1{.{;..*2$.*\- 20/3$-@@*10/3$-..*2$.*+1600<}*}32*' *'=\;\;@@(}60*;(n\}40*;]''+
aditsu
fonte
1

GNU bc, 136 bytes

for(y=-1;y<1;y+=.05){for(x=-2;x<1;x+=.05){for(n=i=r=0;r*r+i*i<4&&++n<32;r=t){t=r*r-i*i+x
i=2*r*i+y}
if(n<32)print n%A else print " "}
2}

Resultado:

1111112222233333333333333334444445567190 54444333322222222222
11111222233333333333333334444444555780 0765444433333222222222
11111222333333333333333344444445556799 1865544443333322222222
11112223333333333333333444444455561 6 7985554444333332222222
111122333333333333333344444445566784 086555544333333222222
111222333333333333333444444556667797 787665554433333222222
111223333333333333344444455678988903 309866625443333322222
11123333333333333344444555673430 0 203 98897543333332222
11223333333333333444455556672 75 224654544333332222
11233333333333344455555566781 29554333333222
11233333333333445555555666808 7654333333222
113333333334445666555666782 5 37654433333322
123333334444557477778777782 70254433333322
12333344444556749990198881 64433333322
13334444445556709 25 51902 4864433333332
13344444455557795 728 4054443333332
1344444455557792 6 854443333332
1444444555672919 654443333332
144444666678368 8654443333332
1556787778915 07654443333332
1 387654443333332
1556787778915 07654443333332
144444666678368 8654443333332
1444444555672919 654443333332
1344444455557792 6 854443333332
13344444455557795 728 4054443333332
13334444445556709 25 51902 4864433333332
12333344444556749990198881 64433333322
123333334444557477778777782 70254433333322
113333333334445666555666782 5 37654433333322
11233333333333445555555666808 7654333333222
11233333333333344455555566781 29554333333222
11223333333333333444455556672 75 224654544333332222
11123333333333333344444555673430 0 203 98897543333332222
111223333333333333344444455678988903 309866625443333322222
111222333333333333333444444556667797 787665554433333222222
111122333333333333333344444445566784 086555544333333222222
11112223333333333333333444444455561 6 7985554444333332222222
11111222333333333333333344444445556799 1865544443333322222222
11111222233333333333333334444444555780 0765444433333222222222
Trauma Digital
fonte
1

CJam, 52 bytes

80,Kdf/2f-_m*{_{_~*2*[\2f#~-\]1$.+}9*\;~mh4<}%80/zN*

Explicação:

80,Kdf/2f-                                             Push [-2, -1.95, ..., 1.95]
          _m*                                          Cartesian product with itself
             {                              }%         Map over each pair [cx, cy]:
              _                                          Push a copy [zx, zy]
               {                  }9*                    Iterate nine times:
                _~*2*                                      Push 2*zx*zy
                     [\2f#~-\]                             Make a pair with zx^2-zy^2
                              1$.+                         Push [cx, cy] and sum vectors
                                     \;                  Destroy [cx, cy]
                                       ~mh               Calculate sqrt(zx^2+zy^2)
                                          4<             1 if bounded, 0 if not
                                              80/      Split into rows of 80 booleans
                                                 z     Transpose this matrix
                                                  N*   Join rows with newlines
Lynn
fonte
1

Matlab, 96

[x,y,q]=ndgrid(-1:.03:1,-2:.01:.5,32);c=i*x+y;z=q*0;for i=1:100;z=z.^2+c;end;[q+3*(abs(z)<2),'']


                                                                                                                                                                                                        #                                                  



                                                                                                                                                                                            ##                                                             
                                                                                                                                                                                           #####                                                           
                                                                                                                                                                                      #############                                                        
                                                                                                                                                                                    ##################                                                     
                                                                                                                                                                                   ###################                                                     
                                                                                                                                                                                  ####################                                                     
                                                                                                                                                                                   ##################                                                      
                                                                                                                                                                                     #############                                                         
                                                                                                                                                                          ##  ########################## #   #                                             
                                                                                                                                                  ##    #         ################################################ ####                                    
                                                                                                                                                  #########  # #########################################################  #        #                       
                                                                                                                                                 ######### ##################################################################    ########                  
                                                                                                                                                       ##################################################################################                  
                                                                                                                                              #   #####################################################################################                    
                                                                                                                                              # ##################################################################################### #                    
                                                                                                                                        #### ########################################################################################### #                 
                                                                                                                                         # ############################################################################################## #                
                                                                                                                                       ####################################################################################################                
                                                                                                                                    ##############################################################################################################         
                                                                                                                                     ########################################################################################################              
                                                                                                    #                           ##############################################################################################################             
                                                                                    #####     ############ ###                    ############################################################################################################             
                                                                                    ##############################               ################################################################################################################          
                                                                                   ###################################         ###############################################################################################################             
                                                                              ## #######################################       ################################################################################################################            
                                                                               ###########################################    ############################################################################################################### #            
                                                                             ###############################################  ################################################################################################################             
                                                                           ################################################## #############################################################################################################                
                                                                 #########  ################################################# ###########################################################################################################                  
                        ##                                   ## ####################################################################################################################################################################                       
                                                                ######################################################################################################################################################################                     
                                                                 ########   ################################################# ###########################################################################################################                  
                                                                             ###############################################  #############################################################################################################                
                                                                            ################################################  ##############################################################################################################               
                                                                                #########################################      ################################################################################################################            
                                                                             # #  ######################################       ###############################################################################################################             
                                                                                     ################################           ##############################################################################################################             
                                                                                    ##### #####################  #              #################################################################################################################          
                                                                                     ####     #    ###   #   #                     ############################################################################################################            
                                                                                                                              # ### #########################################################################################################              
                                                                                                                                     ####################################################################################################### ###           
                                                                                                                                  # ## ##########################################################################################################          
                                                                                                                                       # ##################################################################################################                
                                                                                                                                        ###################################################################################################                
                                                                                                                                       #################################################################################################                   
                                                                                                                                               ######################################################################################                      
                                                                                                                                                   #####################################################################################                   
                                                                                                                                                   ############################################################################ #########                  
                                                                                                                                                ########## ################################################################ #    #########                 
                                                                                                                                                   #######     ## #################################################### #                                   
                                                                                                                                                                   ########################################### ##  #####                                   
                                                                                                                                                                         ##    # #   #### #### ## ###     #                                                
                                                                                                                                                                                     ###############                                                       
                                                                                                                                                                                  ####################                                                     
                                                                                                                                                                                  #####################                                                    
                                                                                                                                                                                   ###################                                                     
                                                                                                                                                                                  ################## #                                                     
                                                                                                                                                                                       #########                                                           
                                                                                                                                                                                           #####                                                           
                                                                                                                                                                                             #                                                             
flawr
fonte
1

Anterior, 266 bytes

0>:00p58*`#@_0>:01p78vv$$<
@^+1g00,+55_v# !`\+*9<>4v$
@v30p20"?~^"< ^+1g10,+*8<$
@>p0\>\::*::882**02g*0v >^
`*:*" d":+*:-*"[Z"+g3 < |<
v-*"[Z"+g30*g20**288\--\<#
>2**5#>8*:*/00g"P"*58*:*v^
v*288 p20/**288:+*"[Z"+-<:
>*%03 p58*:*/01g"3"* v>::^
   \_^#!:-1\+-*2*:*85<^

Experimente online!

Este é um renderizador Mandelbrot que eu implementei alguns anos atrás para um envio do Código Rosetta . Como o Befunge não tem ponto flutuante, ele usa uma forma aritmética de ponto fixo de 14 bits emulada com operações inteiras. Possui no máximo 94 iterações com o conjunto de caracteres ASCII como "paleta".

Isso foi originalmente implementado tendo em mente a portabilidade, e não o tamanho, mas ainda deve ser razoavelmente bem.

Saída de amostra

Renderização Mandelbrot em arte ASCII

James Holderness
fonte
0

Python 444

print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y>=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24)

Aqui está um dos desenvolvedores de python ,
que , embora não seja muito curto,
é uma linha que é bastante importante.

Anti Terra
fonte
0

c ++ (260)

Código de golfe:

#include<iostream>
void main(){for(float i=-1;i<=1;i+=0.03125){for(float r=-2;r<=1;r+=.03125){float zr=r,zi=i;for(int n=0;n<31;n++){float nzr=zr*zr-zi*zi;zi=zr*zi*2;zr=nzr;zr+=r;zi+=i;}if(zi*zi+zr*zr<4){std::cout<<"*";}else{std::cout<<" ";}}std::cout<<"\n";}}

Exemplo de saída:

                                                               *



                                                           **
                                                          ***
                                                        ****** *
                                                        *******
                                                        ********
                                                        *******
                                                         *****
                                             *     *    * ***    * *
                                                   *************** *
                                              *** ******************
                                              ***********************  ***
                                              ****************************
                                          *   ****************************
                                          *  ****************************
                                          ********************************
                                           ********************************
                                          *********************************  *
                                         *************************************
                                         ************************************
                          *   **        ***********************************
                          ** ******     ************************************
                          **********    *************************************
                         *************  ************************************
                        **************  ************************************
                        *************** ***********************************
                        ***************************************************
                    ******************************************************
                    ******************************************************
************************************************************************
                    ******************************************************
                    ******************************************************
                        ***************************************************
                        *************** ***********************************
                        **************  ************************************
                         *************  ************************************
                          **********    *************************************
                          ** ******     ************************************
                          *   **        ***********************************
                                         ************************************
                                         *************************************
                                          *********************************  *
                                           ********************************
                                          ********************************
                                          *  ****************************
                                          *   ****************************
                                              ****************************
                                              ***********************  ***
                                              *** ******************
                                                   *************** *
                                             *     *    * ***    * *
                                                         *****
                                                        *******
                                                        ********
                                                        *******
                                                        ****** *
                                                          ***
                                                           **



                                                               *
kitcar2000
fonte
você incluiu matemática para sqrt (x ^ 2 + y ^ 2) <2. Você pode comparar com 4 e remover o sqrt e o include.
ilmale
0

Minkolang 0.9 , 77 74 bytes (INVÁLIDO)

Esta resposta é inválida porque o idioma foi criado bem após esse desafio, mas estou publicando para que haja uma solução nesse idioma. Tornando-o bonito raspado 3 bytes woo!

1~12$:;56*[i53*$:1-0c*99*[di39*$:2-+048*[d$~2`9&d*2c+]02@ik" "+Oxx]25*Ox].

Experimente aqui.

Resultado

!!!!!!!!""""""######################$$$$$$$$%%%&&(,**+ %$$$$$$######"""""""""""""
!!!!!!!"""""######################$$$$$$$$$%%%%''(*3+)'&%%$$$$$$######"""""""""""
!!!!!!""""#####################$$$$$$$$$$%%%%&(*--? 5+)(&%%%$$$$$#######"""""""""
!!!!!""""####################$$$$$$$$$$%%&&&&'(,      2)'&%%%%%$$$#######""""""""
!!!!"""####################$$$$$$$$$%%&&&&'''()-      /)('&&&&&%%$$$#######""""""
!!!!""###################$$$$$$$%%%%&)1//))+ ,202    3/.+. ('''(/&%$########"""""
!!!""##################$$$$$%%%%%%&&'),   /               4 +00.2+%%$########""""
!!""################$$$%%%%%%%%%&&&'()+6                        +'&%$$########"""
!!"##############$$%%&%%%%%%%%&&&''2 62                       5,)'&%%$$########""
!!#########$$$$$%%&'.('''''''''''((*/                           ,)+&%$$#########"
!"#####$$$$$$$%%%%&(-,+/)*3+)*(())+                               2&%$$$########"
!###$$$$$$$$%%%%%&'')+1 <56  ;/,++.                              +(&%$$$#########
!#$$$$$$$$%%%%%%&'')+.5         ;/4                              4)&%$$$$########
!$$$$$$$$%%&&&'(4*)+/                                           :=&%%$$$$########
!$%%%%&'&&&&''()+6; 7                                           )'&%%$$$$########
                                                             ?-)'&&%%$$$$########
!$%%%%&'&&&&''()+6; 7                                           )'&%%$$$$########
!$$$$$$$$%%&&&'(4*)+/                                           :=&%%$$$$########
!#$$$$$$$$%%%%%%&'')+.5         ;/4                              4)&%$$$$########
!###$$$$$$$$%%%%%&'')+1 <56  ;/,++.                              +(&%$$$#########
!"#####$$$$$$$%%%%&(-,+/)*3+)*(())+                               2&%$$$########"
!!#########$$$$$%%&'.('''''''''''((*/                           ,)+&%$$#########"
!!"##############$$%%&%%%%%%%%&&&''2 62                       5,)'&%%$$########""
!!""################$$$%%%%%%%%%&&&'()+6                        +'&%$$########"""
!!!""##################$$$$$%%%%%%&&'),   /               4 +00.2+%%$########""""
!!!!""###################$$$$$$$%%%%&)1//))+ ,202    3/.+. ('''(/&%$########"""""
!!!!"""####################$$$$$$$$$%%&&&&'''()-      /)('&&&&&%%$$$#######""""""
!!!!!""""####################$$$$$$$$$$%%&&&&'(,      2)'&%%%%%$$$#######""""""""
!!!!!!""""#####################$$$$$$$$$$%%%%&(*--? 5+)(&%%%$$$$$#######"""""""""
!!!!!!!"""""######################$$$$$$$$$%%%%''(*3+)'&%%$$$$$$######"""""""""""

Explicação

Isso tira proveito do manuseio interno de números complexos do Python, para que eu possa fazer 1~12$:;(o equivalente (-1)**0.5no Python) para obter a unidade imaginária. Depois, há três nested loops For, que percorrer y, x, e z=z^2+c. É necessário romper o loop mais interno (e feito por d$~2`9&) porque, caso contrário, os números ficarão tão grandes que se tornarão (NaN+Nanj), o que aparentemente tem uma magnitude menor que 2.

El'endia Starman
fonte
0

Python 3, 185 bytes

Tradução do perl (193) com algumas melhorias

Y=-1.2
r=range
for _ in r(25):
 X=-2
 for _ in r(80):
  r=i=0
  for n in r(16):
   r,i=r*r-i*i+X,2*r*i+Y
   if r*r+i*i>4:break
  print(".,:;=+itIYVXRBM "[n],end='')
  X+=3/80
 Y+=2.4/25
AMK
fonte
0

> <> , 118 bytes

1 v
2-\:01-(?;0
*&\0084
?!\}::*{::*$@-}2**}:@@:{+r+::*{::*$@+4(&1-:&*
ao\&~:*$:*+4(}" *"{?$~o1aa+,+:1)22@@?!.~~~1aa+,-

Experimente online! Esteja avisado que leva cerca de 25 segundos para executar o TIO, portanto, seja paciente!

Mais um desafio próprio do que uma entrada séria. Produz a seguinte saída:

                                        *                    

                                     *                       
                                   *  *                      
                                    ****                     
                                    *****                    
                                    ****                     
                             *  * ****** * *                 
                             **  **********                  
                             ******************              
                             ******************              
                           * ******************              
                            *******************              
                          ***********************            
                    *      *********************             
                 * ***    **********************             
                 *******  **********************             
                ********* **********************             
                ********************************             
             **********************************              
 *********************************************               
             **********************************              
                ********************************             
                ********* **********************             
                 *******  **********************             
                 * ***    **********************             
                    *      *********************             
                          ***********************            
                            *******************              
                           * ******************              
                             ******************              
                             ******************              
                             **  **********                  
                             *  * ****** * *                 
                                    ****                     
                                    *****                    
                                    ****                     
                                   *  *                      
                                     *                       

                                        *                    
Sok
fonte
0

; # , 150.878 bytes (não competitivo)

Não se encaixa aqui :(

Resultado:

         !!!!!!!!"""""""""""""""""""""""""""##########$$$$%%&(.)(*2%$#######""""""""!!!!!!!!!!!!!!!!!
        !!!!!!!"""""""""""""""""""""""""""###########$$$$%%&'(*0+('&%$$#######""""""""!!!!!!!!!!!!!!!
       !!!!!!""""""""""""""""""""""""""############$$$$$%&(**-:::1('&%$$$#######""""""""!!!!!!!!!!!!!
      !!!!!""""""""""""""""""""""""""############$$$%%%&'(+:::::::02*&%$$$$$######""""""""!!!!!!!!!!!
      !!!"""""""""""""""""""""""""############$$%%%%%&&&'(4:::::::8:'&&%%%$$$$$####"""""""""!!!!!!!!!
     !!!""""""""""""""""""""""""##########$$$%&&'2''''(())+7::::::1*)(('&%%%%%'&$###"""""""""!!!!!!!!
    !!!"""""""""""""""""""""""#######$$$$$$%%&(-:0/+*,::2::::::::::::5:::('''(.+&%$##"""""""""!!!!!!!
   !!""""""""""""""""""""""#####$$$$$$$$$%%%&&(*3:::7:::::::::::::::::::::,::8:1)%$$##""""""""""!!!!!
   !""""""""""""""""""""####$$$$$$$$$$$%%%%&'()*.8::::::::::::::::::::::::::::56&%$$###""""""""""!!!!
  !!""""""""""""""""####$%%%$$$$$$$$%%%%%&'):8:5:::::::::::::::::::::::::::::0*(&%%$$##""""""""""!!!!
  !"""""""""""######$$%%(+'&&&&&&&&&&&&&&''),3:::::::::::::::::::::::::::::::::+(()%$###""""""""""!!!
 !"""""""#########$$$$%%)3*()(()4+(('''''(*9::::::::::::::::::::::::::::::::::::::*%$###"""""""""""!!
 !"""##########$$$$$$%%&'(*/:7.13::/:+*))*-:::::::::::::::::::::::::::::::::::::,(&%$####""""""""""!!
 ""##########$$$$$$$%&&&()+0:::::::::::2,,0:::::::::::::::::::::::::::::::::::::::&$$####"""""""""""!
 "#########$$$$$$$%(''((*0:::::::::::::::1::::::::::::::::::::::::::::::::::::::,'%$$#####""""""""""!
 ########$%%%%%%&&'(+.,..5::::::::::::::::::::::::::::::::::::::::::::::::::::::'%%$$#####""""""""""!
 $$$%%&&(&&'''''(,*+.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::*'&%$$$#####""""""""""!
 $$&%%'):)('))((),,,9::::::::::::::::::::::::::::::::::::::::::::::::::::::::,('&%$$$#####""""""""""!
 ##$$$##$%%%%%%&&&'(*8181::::::::::::::::::::::::::::::::::::::::::::::::::::::*&%$$$#####""""""""""!
 "#########$$$$%%%&(+(()*.:::::::::::::::4:::::::::::::::::::::::::::::::::::::::&%$$#####""""""""""!
 ""##########$$$$$$$%&&'+*-2::::::::::::..4::::::::::::::::::::::::::::::::::::::/&$$####"""""""""""!
 """"##########$$$$$$%&&'(*2::4::::::0.**+-:::::::::::::::::::::::::::::::::::::,(&%$####"""""""""""!
 !"""""##########$$$$%%&'-3.-*)*-:+)8(((()*.:::::::::::::::::::::::::::::::::::::,'%$####""""""""""!!
  !"""""""""#######$$$%%'4''&&&')('&&&&&''(+/::::::::::::::::::::::::::::::::::-5+-%$###""""""""""!!!
  !"""""""""""""""####$%&%%%%%%$$$%%%%%&&&')::::::::::::::::::::::::::::::::::.('&%$$###""""""""""!!!
   !"""""""""""""""""""###$$$$$$$$$$$$%%%%%&(-*-1:::::::::::::::::::::::::::::/(&%$$###""""""""""!!!!
   !!"""""""""""""""""""""#####$$$$$$$$$%%%%&'(+::::::::::::::::::::::::::0::::,7%$$##""""""""""!!!!!
    !!"""""""""""""""""""""""#######$$$$$$%%%&*:::4:+-::::::::::::::::::.)):7)+,(%$##""""""""""!!!!!!
    !!!""""""""""""""""""""""""##########$$$%&:)2/)(((+,*+,/::::::/,+))5(&&&&&'+%$##""""""""""!!!!!!!
     !!!!"""""""""""""""""""""""""###########$$%%%%%&&&''),::::::::8('&&%%%%$$$$###"""""""""!!!!!!!!!
      !!!!""""""""""""""""""""""""""############$$$%%%%&'(+::::::::-(&%%$$$$$#####"""""""""!!!!!!!!!!
       !!!!!""""""""""""""""""""""""""############$$$$$%%)+2,/:::,**'%$$$$#######""""""""!!!!!!!!!!!!
        !!!!!!"""""""""""""""""""""""""""###########$$$$$%&&'),:,)'&%$$$#######""""""""!!!!!!!!!!!!!!
         !!!!!!!!""""""""""""""""""""""""""###########$$$$%&'(.,,-*%%$#######"""""""!!!!!!!!!!!!!!!!!
MD XF
fonte
Você não precisa de tantos detalhes.
Rɪᴋᴇʀ 27/05