I wrote many. One I remember is writing a little piece of code that'd pick "optimal" starting positions in the board game The Settlers of Catan. Now by "optimal" I don't mean it was actually the absolute best position possible according to the complete rules of the game but the system would use a few heuristics to determine an optimal position according to simplified rules.
Then each "player" (well computer player really) would pick it's starting position in an optimal way according to these rules.
It's fun because the set up of the game begins like this (say there are three players):
p1 puts his first village and one road
p2 puts his first village and one road
p3 puts his two villages and two roads at once
p2 puts his last village and one road
p1 puts hist last village and one road
The idea being that p1 is so advantaged by the fact that he picked the best spot, that he then gets to put his second village only after the other players have put everything in place.So it's cute from an game theory point of view to find the "optimal" (according to my rules at least). It's just recursion. Each player knows that the next player is going to play optimally too and they all pick their spot(s) accordingly after having evaluated all possible positions.
> What was your motivation?
Just having fun.