Since this pertains to both VB and maths, I'll post it here too, I might even get a better response :P



Here's three screenshots from a program I'm making, n=1, n=2 and n=3. You can see where it's going. With n=1 only one tile is selected, n=2 all the surrounding tiles, n=3 all the surround tiles of those tiles.

At the moment it's I just typed in a big mofo 'If' statement for the purposes of showing what it's supposed to do. What I need to do is work out some kind of algorithm that can do this automatically.

If anybody can help me out with this I'd greatly appreciate it.

VB source code can be found at http://bloody-cherry.com/math.zip