C语言 棋盘游戏 源代码.docVIP

  • 2
  • 0
  • 约2.07千字
  • 约 3页
  • 2017-07-26 发布于河南
  • 举报
C语言 棋盘游戏 源代码

# include stdio.h # include stdlib.h char matrix[3][3];/*定义游戏棋盘 */ char check(void); void init_matrix(void); void get_player_move(void); void get_computer_move(void); void disp_matrix(void); int main() { char done; printf(This is the game of Tic Tac Toe.\n); printf(You will be playing against the computer.\n); done = ; init_matrix(); do{ disp_matrix(); get_player_move(); done = check();/*检测输赢*/ if(done!= )break;/*赢了*/ get_computer_move(); done = check();/*检测输赢 */ }while (done == ); if(done==X) printf(You won!\n);

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档