rules:
Rules: 1. make the grid of a neighborhood 2. make the expansion of each block 3. add colour as the blocks expand 4. make the colour…