📄 queen.h
字号:
// ****************************************************// Header file Queen.h // ****************************************************#ifndef QUEEN_H#define QUEEN_Hclass Board;class Queen {public: Queen(); // Puts queen in upper left corner of board. Queen(int inRow, int inCol); // Places Queen in supplied location. int getCol() const; // Returns column number. int getRow() const; // Returns row number. void nextRow(); // Moves queen to next row. bool isUnderAttack() const; // Determines whether the queen is under attack by another queen. // If there is a queen in the same row or the same diagonal, // returns true; otherwise, returns false. static void setBoard(const Board *bPtr); // Saves a pointer to the board for all queens.private: // Row and column of queen if it is on the board. // Otherwise, prospective row and column of queen. int row; int col; static const Board *boardPtr; // All queens share the same board.};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -