I was wondering if you can use the Math.random method to generate random 0’s and 1’s?
I need to fill up a 2 dimensional array to make it essentially like a maze with the 1’s being the path and 0’s being the walls.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A maze with random paths is no more a valid maze! The paths in a maze are fixed and not random, though they seem to be! say for example,
The above one is a valid maze, but once the paths are random,its no longer a valid maze!(below)
Here are some examples of maze generation codes for your reference.