Got youtube blasting some melodic dubstep and my body buzzing wtih a couple new brews.
Tinkering away today, trying to make some additions to the code that I think would be useful.
Added an array that keeps track of the filled coordinates.
So if the random selection chooses an already filled coord, it would look for another one*.
Then realised that the clear button didn't refresh the array, i.e. once the initial map generation was done, the array would keep the locations in memory but the picturebox was still cleared and generate button appeared to do nothing.
So I set up a toggle switch that would allow multiple generate and clear cycles. Without the appearance of 'nothing' happening.
But that's given me an idea - create a call to the array to recreate the generated
map from the stored values - going to need to wire up a new button.
something for another
night.
*Current code simply skips an iteration rather than trying again until a
spare coord is found. Will ponder about if that is something I want.
No comments:
Post a Comment