Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by Nero_3D
foreach uses the values as indexes, so I think this could work
pawn Код:
new rand = Iter_Random(Frontier[0]));
if(Iter_Next(Frontier[0], rand) == Iter_Size(Frontier[0])) { rand = Iter_First(Frontier[0]); } RandomCell[0] = Iter_Next(Frontier[0], rand); RandomCell[1] = Iter_Next(Frontier[1], rand);
|
Thats almost exactly what I had, but wouldn't you subtract from rand? Doing so would remove the need to loop back to index one.
Anyways, now that that's off my plate I need a way to loop through all cells and store only frontier cells. My current method did not work. If you do not know what I mean go
here.