[問題] C++作OOXX

看板HSNU_1120作者 (司馬中路無敵)時間17年前 (2008/06/02 18:50), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
#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
hw7勒
06/02 20:06, 1F

06/02 20:20, , 2F
我只寫完五小題 小智大大救我
06/02 20:20, 2F
文章代碼(AID): #18Gz29HU (HSNU_1120)