/******************************************************************
 *						Author:	Zhou Yundong
 *						Time: 20080425 20:49
 ******************************************************************/
#include "Stdafx.h"
#include "Think.h"

#define MaxSeries 81

bool initAreaSum()
{
	int i;
	int idxSeries[MaxSeries][MaxSeries];
	int pIdxSeries[MaxSeries];
	for(i=0; i<81; i++)
	{
		pIdxSeries[i] = 0;
	}
	for(i=0; i<81; i++)
	{
		idxSeries[idx[i]-1][pIdxSeries[idx[i]-1]++] = i;
	}
	return true;
}

void getAnswerSum()
{
	if(!initAreaSum()) return;
}

void handleAnswerSum()
{
	rightStatus = 1;
	moveIdx('l', 'i');
	getAnswerSum();
	if(firstIntoSodoku) // 只在第一次变成数独状态时才清右盘
	{
		firstIntoSodoku = false;
		movePare('0', 'r'); // 0 to rightPare
	}
	if(flagAnswer == 0)
	{
		moveBoard('0', 'r'); // 0 to rightBoard
	}
	else
	{
		moveBoard('a', 'r'); // answerBoard to rightBoard
	}
	underThinking = false;
}
