Implemented Carcassonne’s rules over the weekend (hacking toward an AI). Scoring farms was very hard to express. Anyone have elegant tricks?
Conversation
I want to say flood fill, but that’s probably too simplistic and requires a bunch of edge cases. What did you use?
2
@tennabey Problem with floodfill is having to define all of the borders in the tiles.
1
@tennabey I guess each tile divided into eights with segment walls marked open or closed to cover all tile types?
1
Replying to
@tennabey Yeah, that’s pretty much what I did. But then: which completed cities does it touch? Don’t count one twice!
Replying to
@tennabey Start with numbering the completed cities, for each separate farm tick them off so no double counting.


