John Hatpin <RemoveThisjfhopkin@[EMAIL PROTECTED]
> wrote:
> OK, I've just run a test that simply tests the whole sim, with an
> accurate timer called "counting seconds in my head". Each 255 'row'
> of cells takes about one second, so it would take about four minutes
> to test the whole sim. That's a bit long for this application, not to
> mention for me developing the damned thing, with repeated re-runs.
I think you're doing it wrong.
You've got this invisible thing that makes bird noises, and it loads in
a place you control. Why not use that thing as a database cursor?
Here's your algorithm. Thing loads at X,Y. Store that.
1) Go "cheep cheep cheep"
2) Do you own X+1,Y?
If yes, go there.
If no, you've found an edge. Store that. Do you own X,Y+1?
If yes, go there
If no, you've found an edge. Store that. Do you own X-1,Y?
If yes, go there.
If no, you've found an edge. Store that. Do you own X,Y-1?
If yes, go there
If no, you've found an edge. Store that.
3) Are you in X,Y?
If yes, you're done. You've mapped a rectangle you own, bounded by
the other four locations you stored, and you can walk randomly
within the bounds of that.
If no, you're not done yet. Goto 1.
This breaks down if the shape is irregular (like an L, or pretty much
anything else) since it's only going to find one rectangular space
inside that, but once you've stored that in an array, you can walk
randomly within that space, but the initial 'finding of the borders' can
be done by the bird itself, can't it?
--
Huey


|