[問題] C++作OOXX
#include "hw7.h"
void initializeBoard(Stone board[])
{
for(int i=0; i<9;i++)
{
Stone board[i]==EMPTY;
}
}
void printBoard(Stone board[])
{
for(int i=0; i<4; i++ )
{
cout<<"+-----+-----+-----+"<<endl;
for(int j=0;j<9;j++)
{
if(int j==2||j==5||j==8)
{
for(int k=j-2;k<=j;k++)
{
cout<<"| ";
if(board[k]==COMPUTER)
cout<<"X";
else
{
if(board[k]==USER)
cout<<"O";
else
cout<<" ";
}
cout<<" ";
}
cout<<"|"<<endl;
}
else
{
cout<<"| | | |"<<endl;
}
}
bool userFirst()
{
do
{
cout<<"Are you taking first? (Y/N):"<<endl;
char ans;
cin>>ans;
if(int(ans)=='Y'||int(ans)=='y')
return true;
else
if(int(ans)=='N'||int(ans)=='n')
return false;
}while (int(ans)!='Y'||int(ans)!='y'||int(ans)!='N'||int(ans)!='n')
}
bool isValidMove(int move, Stone board[])
{
if(move>8||move<0)
return false;
for(int i=0;i<=8;i++)
{
if(board[i]!=EMPTY)
return false;
}
}
void userMakingMove(Stone board[])
{
int move;
do
{
cout<<"Input a move (0~8): "<<endl;
cin move;
bool isValidMove;
board[move]==USER;
}while(move<0||move>8)
}
void computerMakingMove(Stone board[])
{
}
bool shouldTerminate(Stone board[])
{
}
void getValidMoves(Stone board[], int movesArray[], int& numMoves)
{
}
int getLineScore(Stone s1, Stone s2, Stone s3)
{
}
int getScore(Stone board[])
{
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.4.234
推
06/02 20:06, , 1F
06/02 20:06, 1F
→
06/02 20:20, , 2F
06/02 20:20, 2F