## Mandelbrot Set ASCII Viewer

The Mandelbrot Set is the set of all complex points which, when one iteratively and infinitely applies the function $f_c(z)=z^2+c$, converge to a value. This simple rule results in stunning complexity and beauty.
Many Mandelbrot Set animations use regularly colored pixels to represent the number of iterations needed at the fractal’s edges to escape converging. Yet this mathematical object can also be represented as ASCII characters — similar to what I did in my Curses Cam post. The characters are chosen according to their opaqueness. A full stop (‘.’) looks lighter than a dollar sign (‘\$’), so they represent a smaller or larger number of iterations needed. The order of characters used is taken from this post by Paul Borke.
As there are only 70 characters used, each frame is being rendered twice to determine the minimum number of iterations needed by every point in that frame. Thereby the full visual character range is used.

The characters shown below represent a Mandelbrot Set still. To see the zoom in action, either run the program (listed below) or take a look at this Mandelbrot Set ASCII journey.

```      ..................''''''''``"">>II``''''......
..................''''''''``^^,,ii::^^``''''......
..................''''''''``^^::ww\$\$++,,````''''......
................''''''''``^^^^""::\$\$\$\$\$\$::""^^``''''......
..............''''''````""{{;;XX\$\$\$\$\$\$\$\$uuUU,,,,""''......
............''''``````^^,,rr\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$<<\$\$--``........
........''``````````^^""LL\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$__""``''......
..''''''^^!!"""",,""""::__\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ll""''........
''''````^^::__IIYYii::ll\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$pp^^''........
''``````"";;[[\$\$\$\$\$\$++__\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$^^''''......
``^^^^,,;;>>\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ww``''''......
"",,,,II\$\$nn\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$""``''''......
"",,,,II\$\$nn\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$""``''''......
``^^^^,,;;>>\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ww``''''......
''``````"";;[[\$\$\$\$\$\$++__\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$^^''''......
''''````^^::__IIYYii::ll\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$pp^^''........
..''''''^^!!"""",,""""::__\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ll""''........
........''``````````^^""LL\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$__""``''......
............''''``````^^,,rr\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$<<\$\$--``........
..............''''''````""{{;;XX\$\$\$\$\$\$\$\$uuUU,,,,""''......
................''''''''``^^^^""::\$\$\$\$\$\$::""^^``''''......
..................''''''''``^^::ww\$\$++,,````''''......
..................''''''''``^^,,ii::^^``''''......```

The fractal viewer is written in Python 2.7 and works by determining the terminal’s size and then printing a string of according size. This creates the illusion of a moving image, as the terminal will hopefully always perfectly scroll so that only one frame is visible at a time.
In the code’s first non-comment line one can change the complex point at the image’s center, (really, its conjugate, which is partially irrelevant as the set is symmetric along the real axis) the initial zoom value (complex distance above the image’s center), the zoom factor (the factor by which the zoom value gets multiplied after a frame), the total number of frames (-1 means there is no upper limit), the delay between frames (in seconds, can be floating-point) and the color characters used.

The program’s source code may not be particularly easy to read, yet it does its job and only requires seven non-comment lines! The code is shown below, though the .py file can also be downloaded.
To achieve the JavaScript animation linked to above, I wrote a simple Python converter which takes in the fractal renderer’s output and it spits out an HTML page. This converter’s code is not listed, though the .py file can be downloaded. Instructions on how to use the converter can be seen in its source code.

``````# Python 2.7 Code; Jonathan Frech, 15th and 16th of June 2017
P,Z,F,N,D,K=-.707+.353j,3,.9,-1,.1," .'`^\",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@\$"
def C(c):
global m;z,i=0j,-1
while abs(z)<=2 and i<len(K)-1+M:z,i=z*z+c,i+1
m=min(m,i);return K[i-M]*2
while n<N or N==-1:h=Z*2.;w=h*W/H;R=lambda:"\n\n"*(n!=0)+"\n".join("".join(C(P-complex(w/2-w*x/W,h/2-h*y/H))for x in range(W))for y in range(H));M,m=0,len(K);R();M=max(M,m);S.write(R());S.flush();Z,n=Z*F,n+1;time.sleep(D)``````

## Easter MMXVII

Winds swirl through the air,
Water sloshes at the shore;
A peaceful island.

``````                           vunnnnnnnxvvczYX
uuxrjjft///tfjrnuvvcXXUU
cuxxrf/\|(|||/tttrnxuuvcczYYJL
cuuvnxrjt/\\\/\//tffrxnuvvcccXXYYCLC
cccvuunxjrttttttjjfrrxnnnvvcczXzXUUUJL0
cczvvvuuuxnrxrrrjrxrxnnuuuvvcczXXXXYXUJJLQZ
czzzXzvccvnuunnnnnnnnuuuvuvvccczzzXYXYUYUJCLQO
zzzzXzccvvvvvuunnnnunuunnuuucvzczzXXYXUYJUJJCQ0Oq
XXXXzzzzcccvvvvuuvunnnnnuuuvvvcczzXzXYXXYYUUCCL0Qmp
XXXzXzzzzzcccccvuunnnnnnnnunvucvzzzXzYXXYUUUUJJCL0OZq
XYYYYXXzczzzcczcvuuunxxnxxxnuuuvzzXXXXYXUYUUUUUCJCQ0Owp
YYUYXYYXXXXzczczcvvuunxxrrrxnnuvuzzzzXXXYYUUUUUUJJCCL0Omd
YYUUYUYUXXXXczzzzcvvvunxrxrrrxxnuvcczzXzYYXYXUYUUJJLQQ0OZmk
YUUJJJYUYYXUXYXzczzczuuxrjrrrjrxxccccczzXXXYUYUYUJUCCCL00mwdw
UJCJJJUYXYXXXzzXXzzvvnxxrjjjrjxxuvvczXzXY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qwmmOOZ00OQLQ0LCLQCCCJCLCCCJCCJJUUUJUJUUJUJUJCCCCLCQOOmwpdh#
M#hkbqwmZmZOOO0Q00L0QLCLLQLLQLJCLCCJJCJCUJJJJJJJJCJJLLCQ0ZmwqpkaM
oohkddqwmmmOZOOO0LQL0LLQCL0LCLLLLLCJCJLJJJUUJJJJCCCLQ00OZmwqba*
WM*akbqppwmwZOZOQOO000LQLQQLCCLLLCCCCJJCCCCJCJCLCCCLQ0OZmppboo
MWohhdpwqwwmwOZZZOOO00QLQLQQLLLLLCCCLLLCLCLCLLJLLQ0ZOmmwdbaa
&W#hkbpqwqwqZZZZZZO000QQQ0QLLQLCLLCQCLQLLLLCLLQQL0ZZmwpbkap
8&#ohkbddpqwwmmmZOZOOO0OO0Q0Q0QLLQQLQLLQQ0QQQ00ZOmmqbdha
88WMohobdbpqpwwmqZZmZZZOQZO000Q0OQQQ00QQQ000OZmmqppkk*
M%8M#*okkbppdqqppmwZmmmwOOZZOO00O0O0O0O0OmZqqwqdbkho
B@8&M**ohkbbdqppqwqwwwwwZZZmZmOOOOOZZmmwwppbbkka
@@8&MW*ookkkbdpdpdqpqqwqpwZwZwwmqwqpppdpdkk*
\$\$%%&WM#*oahkkhkddppdpbqwpppppbpdkkbbhho
@\$@B8&WM**#aoaahbkkhkhkbbkkbhhkhkkab
\$@%%8&WWM#M#*o**oooaoooaaaaook
@%%W&WWW#*##o*oa#**#M*
#88&&%8%&
``````

## Second Anniversary

J-Blog celebrates its second anniversary!
Exactly two years ago, on the twenty-eighth of March 2015, the very first post on this blog appeared, appropriately named Hello World. Since then, including this one, 164 other posts have been posted. Here a few of the image highlights from both years, with their corresponding post.

```                                  -
?][)0Zqpkdc
QmphM&88888%av
Z&88%%%8M*%B8X
JW&Mbw\1] ZB@b
?-        #BB%c
m@@@kc
?o@BBC
]&@@*v
L%@%Y
o@BZ
LB@a
]%BM?
*B&v
k%&v
mBWv
wBWv
ZB*
w@O
W8z
[BO
ao]
Ckc                k&z
b@#Z?            [a8L
X%\$@*Q[?      ?[q%&}
{&%%8&kwm00mdM%%w?
?ZW8%%%%%%B8&q]
-}\wpkpft[                        ```

## Christmas

Christmas tree gets chopped,
Excitement fills the people.
Forming winter mood.

```         *
***
*****
*******
*********
***********
*************
***************
*****************
*****       ```

``````__ = 9;_ = chr;"istmas tree gets chopped"
exec _(95)+_(95)+_(95)+_(95)+_(61)+_(108)+_(97)+_(109)+_(98)+_(100)+_(97)+_(32)+_(120)+_(58)\
+_(114)+_(97)+_(110)+_(103)+_(101)+_(40)+_(120)+_(41)+_(10)+_(100)+_(101) +_(102)+_(32)\
+_(95)+_(40)+_(115)+_(41)+_(58)+_(112)+_(114)+_(105)+_(110)+_(116)+_(32)+_(115)
"itement fills the people"
for m in ____(__):"g winter";___ = m;"ood";_(" "*(__-___)+"*"*(2*___+1)+" "*(__-___))
_(" "*(1/2+__-__/4)+"*"*(__/2)+["","*"][1+2*__-__/2-2*(1/2+__-__/4)]+" "*(1/2+__-__/4))``````