0
The following source code is a solution to the Marching Square problem.
The explanation of using random numbers in ambiguous cases can be found here.
import numpy as np
from PIL import Image, ImageDraw
im = Image.new('RGB', (500, 300), (128, 128, 128))
draw = ImageDraw.Draw(im)
class Square():
...