Beginner programmer... no idea how to implement this properly
Pretty much I'm making an n x n grid. The goal of the grid is to find a path from the top to the bottom by randomly opening cells. All cells start off blocked. Now here's what I can't figure out.
I need to create this grid (an array) and make pointers to each cell so that I can then traverse the array in order and select a blocked site to open in constant time at each step. I can't figure out how to do this in java though. If anyone could shed some light it would be very much appreciated.
Re: Beginner programmer... no idea how to implement this properly
Firstly i would like to know , are you comfortable with swing or not ?
secondly, talking about logic.
an array as you planned can be used for storing the locations of the board which are currently open for the movement.
for generating random array, you can use java random class.
for utilizing space you can you sparse array.[only valid positions or the positions open for the movement.]