mardi 1 décembre 2020

simple maze generator for python [closed]

i want to make a simple game for one of my first projects. ive just began coding not long ago so im a beginner. my game will be based around the computer making a randomly generated maze each round, and then 2 players will have to compete to solve the maze first. the game will be played locally on one device. im currently stuck on the maze module of my game. im not sure how i can make it randomly generated. ive thought about making a 2d array and filling it with ones and zeros, one representing a solid block and zero an empty space. im not sure how i can make this randomly generated so that every empty space is accessible from elsewhere. can somebody clue me to how this can be achieved? efficiency is not an issue, my maze will only be around about a 8x8. Any comments explaining the code will be appreciated since im pretty new to coding. thanks




Aucun commentaire:

Enregistrer un commentaire