| Author |
Message |
Y Dienyddiwr Da (Dienyddiwr)
| | Posted on Saturday, July 13, 2002 - 4:27 am: | |
What's the best way to simulate an "adjacent-to-friend?" check? |
Karl Scherer (Karl)
| | Posted on Monday, July 15, 2002 - 9:19 am: | |
The word adjacent depends on the topology (connections of positions) you work with. On a square grid with direction n,s,e,w a position is checked for adjacent-to-friend by checking the pieces to the north, south, east and west: (if (or (friend? n)(friend? s)(friend? e)(friend? w) ) ... ) Cheers, Karl |
|