⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queens.h

📁 八皇后问题的一个程序
💻 H
字号:
//FOR GLORY!
//MY HONOUR IS MY LIFE!
/*This implementation keeps arrays to remember which components
  of the chessboard are free or are guarded.*/
const int max_board=30;
int n=0;
class Queens{
public:
	Queens(int size);
	bool is_solved();
	void print()const;
	bool unguarded(int col)const;
	void insert(int col);
	void remove(int col);
	int board_size;

	int m;
	int count;
	void Queens :: solve_from(Queens &configuration);
    
  
private:
   bool col_free[max_board];
   bool upward_free[2 * max_board - 1];
   bool downward_free[2 * max_board - 1];
   int queen_in_row[max_board]; // column number of queen in each row
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -