⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chess_v2.cpp

📁 包括用VC开发的五子棋程序 以及VRML语言写的虚拟地理环境程序
💻 CPP
字号:
#include "Chess.h"
#include <iostream.h>
#include <stdlib.h>

int main()
{
	Chess yffch;
	int tempi,tempj,side;
	
	cout<<"Which side go first?"<<endl<<"1: Person	2:Machine"<<endl;
	cin>>side;
	if ( side==1 )
	{
		yffch.Output();
		yffch.PersonGo(tempi,tempj);
	
		while ( !yffch.Judge() )
		{
			yffch.ComputerGo();

			if ( yffch.Judge() )
				break;
			else
				yffch.PersonGo(tempi,tempj);			
		}
	}
	else
	{
		yffch.ComputerGoFirst();
		yffch.Output();
		
		yffch.PersonGo(tempi,tempj);
	
		while ( !yffch.Judge() )
		{
			yffch.ComputerGo();

			if ( yffch.Judge() )
				break;
			else
				yffch.PersonGo(tempi,tempj);			
		}
	}
	

	Step st1;
	st1=yffch.StepList.GetTail();
	if( st1.side==1 )
		cout<<endl<<endl<<endl<<"Person Win!"<<endl;
	else
		cout<<endl<<endl<<endl<<"Computer Win!"<<endl;

	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -