I want to program an artificial ecosystem of sorts...
starting small, just a 20x40 grid with 3 species.
I have not yet really begun on the programming, but I have forseen a problem, and was hoping someone could help me out, or at least direct me towards what I should think of doing...
alright here is an example...
0 0 0 0 0 0 0 2 0
0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 3
1 1 1 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0
0 = grass
1 = water
2 = character
3 = house
Now lets say I program the '2' to look for '1'(water) through just an easy checking system...right? now lets say I want to program it to take some of '1' to '3'(house). How would I do that? I dont want him to check the whole map for what he should already know is his house, and I also dont want him after he has found his house to have to once again search for the water which he should already know where it is.
I hope that makes sense...