?? chess_v2.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 + -