ftp.nice.ch/pub/next/developer/objc/appkit/Crossword.1.1.NIHS.bs.tar.gz#/Crossword.1.1.NIHS.bs/Source/BackjumpState.m

This is BackjumpState.m in view mode; [Download] [Up]

/*

File BackjumpState.m

This state is used for backjumping search.  The state can keep track of a single nogood.

*/

#import <appkit/appkit.h>

#import "Backjump.h"


/* 行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行  */


@implementation BackjumpState

- squareClass			{	return [BackjumpSquare  class];		}
- wordClass				{	return [BackjumpWord  class];		}
- (BOOL) inNogood		{	return nogood;						}


/* 行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行  */


- initPuzzle: (id) thePuzzle
{
	[super  initPuzzle: thePuzzle];
	nogoodWords = [[List  alloc]  init];
	nogood = NO;
	
	return self;
}


- free
{
	[nogoodWords  free];
	return [super  free];
}


- mustChange: (id) word
{
	[word  mark];
	[nogoodWords  addObject: word];
	nogood = YES;
	
	return self;
}


- isok
{
	if (nogood)
	{
		[nogoodWords  makeObjectsPerform: @selector(clear)];
		[nogoodWords  empty];
		nogood = NO;
	}
	
	return self;
}


@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.