文件名称:C++编程实例详细讲解
文件大小:14.51MB
文件格式:RAR
更新时间:2013-10-11 05:10:41
C++ 编程
C++编程的许多实例讲解 例如贪吃蛇的一段代码: //设置背景 void setBG(int length, int width){ HANDLE hOut; COORD OutChar; OutChar.X = 10; OutChar.Y = 10; int i = 0; int j = 0; for(i = 0; i < width; i++){ for(j = 0; j < length; j++){ bg[i][j].x = i; bg[i][j].y = j; bg[i][j].blocked = false; bg[i][j].food = false; OutChar.X = j+10; hOut = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorPosition(hOut,OutChar); cout << col(BG_WHITE,true) << " "; } cout << endl; OutChar.Y = i+10; SetConsoleCursorPosition(hOut,OutChar); } }