Python 3 code
###############################################################
# 2D Newton's method set generation by a cellular automaton
# (graphics module)
###############################################################

# mod graphics in /Users/strumia/Library/Python/3.6/site-packages/graphics/
import sys
sys.path.append("/Users/strumia/Library/Python/3.6/site-packages/graphics/")
from graphics import *      # import graphics module

Radius = .5     # set escape rate threshold
Cx = 0.0    # set initial x parameter shift
Cy = 0.0    # set initial y parameter shift
Side = .8       # set square area side
M = 300   # set side number of elementary squares
N = 1   # set color map scale factor
Num = 256*N   # set number of cycles
sT= 5    #  set step jump
w = 0   # set starting escape modulus value

import random    # import random module
p = M/2+random.randrange(-M/2,M/2)
q = M/2+random.randrange(-M/2,M/2)

win = GraphWin("Mandelbrot set", int(5*M/3),int(5*M/3))

def rectCol(p,q,w):
   Rect = Rectangle(Point(int(p-sT/2),int(q-sT/2)),
   Point(int(p+sT/2),int(q+sT/2)))
   Rect.draw(win).setFill(color_rgb(int(10*w%255),
   int((128-10*w)%255),int((128+10*w)%255)))

i = 1   # set non-zero index value
while i > 0:    # set random co-ordinates choice cycles
   p = p+random.randrange(-1,2)*sT
   q = q+random.randrange(-1,2)*sT
   if p < 0:
       p = p+2
   elif p > M:
      p = p-2

   if q < 0:
      q = q+2
   elif q > M:
      q = q-2

   Incx = - Side + 2*Side/M*q
   Incy = - Side + 2*Side/M*p
   x = Incx
   y = Incy
   w = 0
   for n in range(1,Num):
      xx = 5*x/6.0 - x*(x*x*x*x - 10*x*x*y*y +5*y*y*y*y)/(x*x+y*y)/(x*x+y*y)/(x*x+y*y)/(x*x+y*y)/(x*x+y*y)/6.0
     yy = 5*y/6.0 + y*(5*x*x*x*x - 10*x*x*y*y + y*y*y*y)/(x*x+y*y)/(x*x+y*y)/(x*x+y*y)/(x*x+y*y)/(x*x+y*y)/6.0
    x = xx
    y = yy
    if (x-Cx)*(x-Cx) + (y-Cy)*(y-Cy) < Radius:     # escape rate condition
       w = n/N
       rectCol(int(M/3+q),int(M/3+p),int(w))

win.getMouse()
win.close()
