《面向对象程序设计》(7)

时间:2025-04-20

void showmenu() {// 输出主菜单 textcolor(TEXTS); system("cls"); printf("1.人机对战\n"); printf("2.双人对战\n"); printf("3.退出\n"); printf("\n请选择[1-3]:"); }

void showsubmenu() {// 打印子菜单 textcolor(TEXTS); system("cls"); printf("1.你先手\n"); printf("2.电脑先手\n"); printf("3.返回上级菜单\n"); printf("\n请选择[1-3]:"); }

int getchoose(int min, int max) {// 获取选项 int choose; do{ choose=getch()-48; }while(choose<min || choose>max); //过滤不在min到max之间的字符 printf("%d",choose); //屏幕回显 return choose; }

//----------------------------------控制部分---------------------------------

bool quit; //是否按下了退出热键 bool regret; //是否按下了悔棋热键

bool getmove(NODE chessboard[][15]) {// 获取光标移动,并响应

// 当按下悔棋、下子、退出热键时,返回true char c; for(;;){ c=getch(); if(c==-32) switch(getch()){ case 72: // 上 cursor.x--; if(cursor.x<0) cursor.x=0; renew(chessboard,cursor.x+1,cursor.y);

《面向对象程序设计》(7).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219