This is CloseComp.m in view mode; [Download] [Up]
/*
* Stratgey: <Close> try to stay close to 5 ahead of your opponent
* note: this seems to work well against aggressive opponents
* author: Erik_Kay@next.com
*/
#import "CloseComp.h"
@implementation CloseComp
+ (const char *)strategyName
{
return "Close";
}
-(int)scoreBoard:(Board *)b forPlayer:(square_state)type
{
int a;
a = abs([b numberOfPiece:type] - 5 - [b numberOfPiece:OTHER_PLAYER(type)]);
return (- a);
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.