本文整理汇总了C++中Coordinate::Initialised方法的典型用法代码示例。如果您正苦于以下问题:C++ Coordinate::Initialised方法的具体用法?C++ Coordinate::Initialised怎么用?C++ Coordinate::Initialised使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coordinate
的用法示例。
在下文中一共展示了Coordinate::Initialised方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
if ( (g_startingRow != GOPTION_INT_NOT_SET) &&
(g_startingColumn != GOPTION_INT_NOT_SET) )
{
if ( (g_startingRow >= g_rows) || (g_startingRow < 0) ||
(g_startingColumn >= g_columns) || (g_startingColumn < 0) )
{
FatalError(
argv[0],
_("Application cannot start outside the board boundaries"),
TOTAL_ALLOC_BAD_OPTIONS_ERR);
}
// overwrite uninitialised starting coordinate with the
// user-selected one
startingCoord.m_row = g_startingRow;
startingCoord.m_col = g_startingColumn;
}
GameTotalAllocation theGame(g_rows, g_columns, startingCoord);
if (theGame.Solve())
{
std::cout << std::endl;
// i18n TRANSLATORS: This string is to be printed when the applications finds
// i18n a solution to a one-player total-allocation game
// i18n Thank you for contributing to this project
std::cout << _("SOLVED!") << std::endl;
// print solved board on the screen
theGame.GetBoard().PrintBoard(std::cout);
}
else
{
std::cout << std::endl;
if (startingCoord.Initialised())
{
// i18n TRANSLATORS: This string is to be printed when the applications cannot find
// i18n a solution to a one-player total-allocation game. The integers printed on the screen
// i18n are (respectively) number of rows, number of columns, starting row and starting column
// i18n A typical string to be printed:
// i18n "Could not allocate all the pieces in this 8x8 board, starting from row 0, column 2"
// i18n Thank you for contributing to this project
printf(_("Could not allocate all the pieces in this %dx%d board, starting from row %d, columnd %d\n"),
g_rows,
g_columns,
g_startingRow,
g_startingColumn);
}
else
{
// i18n TRANSLATORS: This string is to be printed when the applications cannot find
// i18n a solution to a one-player total-allocation game starting from anywhere in the board
// i18n Thank you for contributing to this project
printf(_("Could not allocate all the pieces in this %dx%d board starting from anywhere in the board\n"),
g_rows,
g_columns);
}
}
}
else if (g_mode == 2)
{
// 1vs1 Game (--mode=2)
if ( (g_blockemfilePath == NULL) || (g_blockemfilePath[0] == NULL) )
{
FatalError(
argv[0],