当前位置: 首页>>代码示例>>C++>>正文


C++ Coordinate::Initialised方法代码示例

本文整理汇总了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],
开发者ID:frechilla,项目名称:blockem,代码行数:67,代码来源:main.cpp


注:本文中的Coordinate::Initialised方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。