I tried to make a little simple game to test my logic, and this is a simple maze, it is ugly and still juicy.
The engine works very well, given that the labyrinth already exists (matrix), it may even be nice, but I'm not going to draw a bunch of cards that can set values in 400 (20x20) matrix fields. not funny.
Then I created a function for randomization, setting a floor / wall for each field, and (I expected) not every card is a winning one. then I made another function that checks if the cards are playable (gets two points and checks if there is a valid path between them, then I just pass the beginning and the end. Pretty elegant) and it worked.
If you haven’t noticed this, this is a VERY dumb way to create my random maze for the following reasons:
1 - It may seem very easy (giant islands of the floor or a bunch of walls together, creating only one, extremely visible path, creating a crazy (albeit real) maze
2 - This is potentially the fastest way to create the perfect random maze EVER, but at the same time it is potentially also the slowest, until ... endless. This difference is noticed more when I set the grid to 30x30 or more (when something is not crowded)
3 - He is dumb and insults the logic itself.
In my defense, I did not plan to do this from the very beginning, as described, one thing led to another.
So, I started thinking about how to make a beautiful (full path, difficult and winning) maze, then I thought about how to make small small (let them say) 5x5 blocks with predefined inputs and put them together in a way that suits it , but this will contradict my true random desire, as well as my unwillingness to draw it by hand.
Then I thought of a function to create a random path, ran it once to the end, and ran it several times somewhere near the end, and some transitions and stuff, some created dead ends that seemed better to me, but I just couldn’t imagine imagine that he creates a decent maze.
You can check what I have done so far in this link.
Note. I have no intention of harming anyone on the PC. First, to open it, comment here, saying that it is safe. - Done (thanks, Jonno_FTW)
If you still do not trust him, use a virtual machine.
OBS: I know that this is not the best way to develop anything. I have to get a decent game engine, bla bla bla, it was some kind of challenge for me.