#include"iostream.h"#include"chess.h"#include"rule.h"#include"result.h"voidmain(){ charch; chessch1('x'); chessch2('o'); while(ch!='N'){ initboard(); qipan(); intk=1; while(1){ ch1.xiaqi();//'x'方先下 qipan(); if(ch1.judge()){ ch1.Wins(); ch2.Loses(); break; } if(k==5){//'x'方下了5次还未赢棋,即平手 ch1.Draws(); break; } ch2.xiaqi();//'o'后下 qipan(); if(ch2.judge()){ ch2.Wins(); ch1.Loses(); break; } k++; } ch1.show(); ch2.show(); cout<>ch; }}
1