Visits every cell in grid using supplied selection function
In-built functions to use: visitorDepth, visitorBreadth, visitorRandom,
visitorColumn, visitorRow.
Usage example:
letvisitor = Grids.visitor(Grids.visitorRandom, grid, startCell); for (letcellofvisitor) { // do something with cell }
If you want to keep tabs on the visitor, pass in a Collections.Sets.ISetMutable instance. This gets
updated as cells are visited to make sure we don't visit the same one twice. If a set is not passed
in, one will be created internally.
Visits every cell in grid using supplied selection function In-built functions to use: visitorDepth, visitorBreadth, visitorRandom, visitorColumn, visitorRow.
Usage example:
If you want to keep tabs on the visitor, pass in a Collections.Sets.ISetMutable instance. This gets updated as cells are visited to make sure we don't visit the same one twice. If a set is not passed in, one will be created internally.
To visit with some delay, try this pattern