Lines Matching defs:Col
13 constexpr Board addQueen(int Row, int Col) {
14 return Board(State | ((uint64_t)Row << (Col * 4)));
16 constexpr int getQueenRow(int Col) {
17 return (State >> (Col * 4)) & 0xf;
19 constexpr bool ok(int Row, int Col) {
20 return okRecurse(Row, Col, 0);
22 constexpr bool okRecurse(int Row, int Col, int CheckCol) {
23 return Col == CheckCol ? true :
25 getQueenRow(CheckCol) == Row + (Col - CheckCol) ? false :
26 getQueenRow(CheckCol) == Row + (CheckCol - Col) ? false :
27 okRecurse(Row, Col, CheckCol + 1);
29 constexpr bool at(int Row, int Col) {
30 return getQueenRow(Col) == Row;
35 constexpr Board buildBoardRecurse(int N, int Col, const Board &B);
36 constexpr Board buildBoardScan(int N, int Col, int Row, const Board &B);
38 int N, int Col, int Row, const Board &B) {
39 return Try.Failed ? buildBoardScan(N, Col, Row, B) : Try;
41 constexpr Board buildBoardScan(int N, int Col, int Row, const Board &B) {
43 B.ok(Row, Col) ?
44 tryBoard(buildBoardRecurse(N, Col + 1, B.addQueen(Row, Col)),
45 N, Col, Row+1, B) :
46 buildBoardScan(N, Col, Row + 1, B);
48 constexpr Board buildBoardRecurse(int N, int Col, const Board &B) {
49 return Col == N ? B : buildBoardScan(N, Col, 0, B);
57 constexpr bool Board::check(const char *p, int Row, int Col) {
60 *p == 'o' ? at(Row, Col) && check(p+1, Row, Col+1) :
61 *p == '-' ? !at(Row, Col) && check(p+1, Row, Col+1) :