MazePlex
For this week's Creative Code challenge by @sableRaph: “ Youth Games”, MazePlex takes a Python heatmap script and transforms the outputs into various mazes.
Poem
Getting Around the Maze
Seeing if there are any crack
Any place
That has enough space
To crawl, where the path doesn’t lack
Starting Lines,
Ending points but first, got to make it to the ending sign
Images





Python Code
import numpy as np
import seaborn as sns
import matplotlib.pylab as plt
def battle():
boats = [0,1,2,3,4,5,6,7,8,9,10,11]
prob = [0.025,0.025,0.05,0.05,0.05,0.05,0.1,0.1,0.1,0.1,0.2,0.15]
shipyard2 = np.random.choice(boats, (16,16), p=prob)
return shipyard2
def plotting(x,color):
letters = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P']
uniform_data = x
ax = sns.heatmap(uniform_data, linewidth=0.5,cmap=color)
ax.set_xticklabels(letters)
plt.show()
return x
plotting(battle(),"Purples")
plotting(battle(),"Oranges")
plotting(battle(),'RdBu_r')
plotting(battle(),'terrain')
plotting(battle(),'terrain')
plotting(battle(),'RdBu_r')