Diary Preparing for Minimax

When I originally estimated the introduction of an unbeatable computer player I thought it wouldn’t take more than two days.

I didn’t put into consideration how many changes would be required to make implementing a minimax. It occurred to me while test driving the score method in the minimax class that the Board class had no current or other player method. The responsibility was rightly in the Game class.
At first I thought that I had made a mistake, but all this highlighted that the API needed to change which in this case was okay. It revealed a new use case that a future client of the API might perhaps need.

This took me down a deep rabbit whole, I began implementing all sorts of different methods, methods that I had forgot to add previously like IsGameDrawn().

I truly wonder if I had taken a different path earlier, would’ve got myself into this little predicament.

Ced

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s