本文整理汇总了C++中screen::printChar方法的典型用法代码示例。如果您正苦于以下问题:C++ screen::printChar方法的具体用法?C++ screen::printChar怎么用?C++ screen::printChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类screen
的用法示例。
在下文中一共展示了screen::printChar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mazeMe
bool mazeMe(int row, int column, int plane)
{
int nNewRow, nNewColumn, nNewPlane = 0;
if (not mazeSolved())
{
for (int nIndex = 0; nIndex <= 26; nIndex++)
{
nNewRow = row + aMoves[nIndex].row;
nNewColumn = column + aMoves[nIndex].column;
nNewPlane = plane + aMoves[nIndex].plane;
if (validMove(nNewRow, nNewColumn, nNewPlane))
{
aBoard[nNewRow][nNewColumn][nNewPlane].value = '-';
objScreen.printChar('-',
aBoard[nNewRow][nNewColumn][nNewPlane].x,
aBoard[nNewRow][nNewColumn][nNewPlane].y,
32, 0, 0, 25000);
if (not mazeMe(nNewRow, nNewColumn, nNewPlane))
{
aBoard[nNewRow][nNewColumn][nNewPlane].value = 'B';
objScreen.printChar('B',
aBoard[nNewRow][nNewColumn][nNewPlane].x,
aBoard[nNewRow][nNewColumn][nNewPlane].y,
31, 0, 0, 25000);
}
else nIndex = 27;
}
}
}
return mazeSolved();
}
示例2: printArray
void printArray()
{
for (int plane = 0; plane <= 4; plane++)
{
for (int row = 0; row <= 9; row++)
{
for (int column = 0; column <= 9; column++)
{
objScreen.printChar(aBoard[row][column][plane].value,
aBoard[row][column][plane].x,
aBoard[row][column][plane].y);
}
}
}
}
示例3: main
int main()
{
bool bCont = true;
char strCont = 'y';
while (bCont)
{
objScreen.clearScreen();
objScreen.moveCursor(0, 0);
cout.flush();
buildArray();
printArray();
if (aBoard[0][0][0].value == ' ')
{
objScreen.printChar('-', aBoard[0][0][0].x, aBoard[0][0][0].y, 32, 0, 0, 25000);
}
if (mazeMe(0, 0, 0))
{
objScreen.printString("Puzzled Solved!", 1, 22, 25000);
}
else
{
objScreen.printString("Puzzle Unsolvable.", 1, 22, 25000);
}
objScreen.moveCursor(0, 23);
cout.flush();
objScreen.printString("Do you want to play another game (y/n)? ", 1, 23, 25000);
cin >> strCont;
if (strCont == 'n')
{
bCont = false;
}
cin.ignore(1000, '\n');
}
return 0;
}