gulley / Monte-Carlo-Games

Strategy-free robot board games.
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

Factor out ConnectFour victory condition #6

Closed gulley closed 10 years ago

gulley commented 10 years ago

I now have three different games that only differ by the victory condition, resulting in a lot of copy/paste.

jhicklin commented 10 years ago

Well then they should all be subclasses of the same shared superclass. The superclass contains all the things they share in common, and each subclass overrides one or two methods, providing their own winning analysis.

You should wind up with much less copy/paste.

You take a shot at that and let's talk about.

Joe

On Aug 29, 2014, at 6:23 PM, "Ned Gulley" notifications@github.com<mailto:notifications@github.com> wrote:

I now have three different games that only differ by the victory condition, resulting in a lot of copy/paste.

Reply to this email directly or view it on GitHubhttps://github.com/gulley/Monte-Carlo-Games/issues/6.

gulley commented 10 years ago

Thanks for the suggestion. That worked great.