# WCCC_YouthGames

# 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

```ocaml
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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1739721935987/9baa371d-3e87-429f-932f-52c14d7cab62.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1739721914455/29113e0a-dda7-4c3f-ad8e-9ed113a22953.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1739721944664/3df9806c-8a52-4684-bc01-82c922bbe0d2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1739721920683/14a34428-0d86-47b2-9095-5a0c8c17d95d.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1739721926950/b9bbc22e-2a41-461c-89db-b93ab2aa830c.png align="center")

## **Python Code**

```python
import numpy as np
import seaborn as sns
import matplotlib.pylab as plt

def battle():
    #using the 0 & 1 to represent a ship versus the ocean and having a weighted value of 0.8 for ocean, 0.18 for boats and 0.02 for mines
    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]

    #by adding the (10,10) instead of 5, able to make an array with the weighted values
    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'] #set for the columns
    uniform_data = x
    ax = sns.heatmap(uniform_data, linewidth=0.5,cmap=color) #changing it to blue for ocean representation
    ax.set_xticklabels(letters) #setting the ticks of the x axis to letters
    plt.show()
    return x

#Example Set
plotting(battle(),"Purples")
plotting(battle(),"Oranges")
plotting(battle(),'RdBu_r')
plotting(battle(),'terrain')
plotting(battle(),'terrain')
plotting(battle(),'RdBu_r')
```
