[Question]
  [
This challenge requires a small amount of knowledge about [chess](/questions/tagged/chess "show questions tagged 'chess'"). A description of the details required can be found at the bottom if you are not familiar with chess or want a refresher.
For a certain board configuration consisting only of queens we can say that each queens *threat number* is the number of other queens it threatens.
Here is an example board with each queen labeled by their threat number:
```
. . . . . . . .
. . . . . . . .
. . . 2 . . . .
. . . . . . . .
. . . . . . . .
. 2 . 3 . . 2 .
. 1 . . . . . .
. . . . . . . 0
```
A board is at a peaceful standoff if every queen can only attack other queens with the same threat number as themselves.
For example:
```
. . . . . . . .
. . . . . . . .
. 2 . 2 . . . .
. . . . . . . .
. . . . . . . .
. 2 . 2 . . . .
. . . . . . . .
. . . . . . . .
```
Each queen can attack 2 others so it's a peaceful standoff.
As another example:
```
3 . . . . . . 3
. . . . . . . .
. 1 . . . . 1 .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
3 . . . . . . 3
```
Here not all queens have the same threat number. Some threaten 3 others and some only threaten 1 other. However none of the `3`s threaten a `1` (or vice versa) so it's peaceful.
## Task
You will take as input a chessboard and output whether it is a peaceful standoff. You may assume the input board is always the standard chess size of 8 units by 8 units and you may take it as a list of list of booleans, a list of piece locations or any other reasonable format.
You may not require the threat numbers to be pre-calculated in the input. They are shown in the above examples but they are not a part of the input.
You should output one of two consistent distinct values. One when the input is a peaceful standoff and the other when it is not.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the goal is to minimize the size of your source code as measured in bytes.
## Test cases
### False
```
. . . . . . . .
. . . . . . . .
. . . Q . . . .
. . . . . . . .
. . . . . . . .
. Q . Q . . Q .
. Q . . . . . .
. . . . . . . Q
. . . . . . . .
. Q . Q . Q . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
```
### True
```
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . Q . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . Q . . . .
. . . . . . . .
. . . . . . . .
. Q . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . Q Q . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. Q . Q . . . .
. . . . . . . .
. . . . . . . .
. Q . Q . . . .
. . . . . . . .
. . . . . . . .
Q . . . . . . Q
. . . . . . . .
. Q . . . . Q .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
Q . . . . . . Q
Q . . . . . . Q
. . Q . . Q . .
. Q . . Q . Q .
. . Q . . . . .
. . . . . Q . .
. Q . Q . . Q .
. . Q . . Q . .
Q . . . . . . Q
```
## Chess
Chess is a game played on an 8 by 8 square grid. Each location on the grid can have up to 1 piece. One such piece is the "queen". Queens can attack any piece that's located in the same row, column, or diagonal as they are, so long as there's not another piece between them an their target. If a piece can attack a piece it is considered to "threaten" that piece.
  
[Answer]
# JavaScript (ES6), 157 bytes
Expects a binary matrix. Returns an inverted Boolean value.
```
m=>(F=p=>m.some((r,y)=>r.some((v,x)=>!p*([s=0,..."1235678"].map(d=>(g=X=>((X+=d%3-1)|(Y+=~-(d/3)))&8?0:v*(V=m[Y][X])?s+=p|V!=v:g(X))(x,Y=y)),r[x]=s))))(F(1))
```
[Try it online!](https://tio.run/##vVTbTgIxEH3frygkygwsFSQqwQw8yXtDQiDAw2a34Jq92a4EIvrr62IItwCCgmnS5kzPzDm9vlhjS9vKjeJiEDoyGVLiUx2aFFHd5zr0JYAyp0h1tUBjc5KiTJSHnqaSyTnPlm8rd/cP1eyA@1YETpo/ok7aQ6dAzlWlWMYZdAv0WQTnpoKI19VGqTbOQ5v8XnfQ6wywoQsUzdoZGtdG0EGEidmlKaKpepMB6TQHoQllxETJ1zdXScgNdQ65kpbTdD3ZmgY2lJDHYStWbjAC5Dry3Biy/aAfZJEPQ/Vk2c@gGdXZu8GYJ2PmM2J6RUxpc//flGWYLaL2PFqYD8RyIpcaekyr2GGgQ09yLxzBEPx58AMTzjaasRuLH@bXsVjyxRLv4wvjQAFxpODf8MUF/s2AOK@BU8/8wjsgTjJ0dgPi16/gKANi61kc2mJxhhVv6@00IFb3wFhHYnkkuwTEnn9gs96W3hc "JavaScript (Node.js) – Try It Online")
## How?
This code solves the puzzle in two passes:
* When called with \$p=1\$, \$F\$ computes the number of queens that interact with each queen, updates the matrix accordingly and returns \$\text{false}\$.
* When called with \$p=\text{false}\$, \$F\$ tests whether at least one queen interacts with a queen that interacts with a different number of queens.
## Commented
### Main wrapper
```
m => F(F(1))         // call F(1), then call F(false)
```
### Helper function F
```
F = p =>             // p = pass
m.some((r, y) =>     // for each row r[] at position y in m[]:
  r.some((v, x) =>   //   for each value v at position x in r[]:
    !p * (           //     do not trigger some() during the 1st pass
      [ s = 0,       //     initialize s to 0 and build the list
        ..."1235678" //     [ 0..3, 5..8 ]
      ].map(d =>     //     for each direction d in this list:
        g(x, Y = y)  //       invoke g with (X, Y) = (x, y)
      ),             //     end of map()
      r[x] = s       //     update m[y][x] to s
    )                //
  )                  //   end of inner some()
)                    // end of outer some()
```
### Helper function g
```
g = X =>             // X is passed explicitly,
                     // Y is passed implicitly
(                    //
  (X += d % 3 - 1) | // add dx = (d mod 3) - 1 to X
  (Y += ~-(d / 3))   // add dy = floor(d / 3) - 1 to Y
)                    //
& 8 ?                // if the resulting position is out of bounds:
  0                  //   stop the recursion
:                    // else:
  v *                //   force the test to fail if there's no queen
                     //   on the source square
  (V = m[Y][X])      //   let V be the value stored at (X, Y)
  ?                  //   if there's a queen there:
    s +=             //     increment s if:
      p |            //       this is the first pass
      V != v         //       or V is not equal to v
  :                  //   else:
    g(X)             //     keep testing this ray
```
[Answer]
# Python3, 301 bytes:
```
lambda b:all(all(len([*t(b,x,y)])==len([*t(b,X,Y)])for X,Y in t(b,x,y))for x in R(8)for y in R(8)if b[x][y])
R=range
def t(b,x,y):
 q=[(x,y,X,Y)for X in[-1,0,1]for Y in[-1,0,1]if X or Y]
 while q:
  x,y,X,Y=q.pop(0)
  A,B=x+X,y+Y
  if 0<=A<8 and 0<=B<8:
   if b[A][B]:yield(A,B)
   else:q+=[(A,B,X,Y)]
```
[Try it online!](https://tio.run/##tZTRTsIwFIav7VOccEMrk4CITkIv4AFM6hVkLmbLOq2p3ZgzsqfHtsCApCCIZlnS/2vP6b/T9eRV@Zqpnp8Xi5Q@LWT0HicRxINISmxeyRUOLksce3OvIiGhdEMm3lSTNCtAj0AoWC@zbG7II/atqNZCpBAH8zCoQoIeaRGpF44SntahAwQzGmA9tOltch0bXHW9jtcNjZ5uaZ1uAoaFCL5eheQw0xlgFU5n7TzLcYdoNPLGdN6aeFVrqpWO6wzpaOhDpBIzHA99EwjW3ygMxuGgElwmWMeZcODygw9mLe1Nk@WnL@IuUGg0Gm3YeZBbsx/mtzWr17Na71vPtAMUX@@zsk7Fjtz6LG2t9E6pyv9auflbK@wMK/1DVk79N86ryu3xVWEnWTtNWy93x3phv75Cx5bFX1phu7fr4AmwPygDc9zm@/1W2OaHQduK1Sfm2ortaSy7@RxWbHPOnuMsKhKc6P58UfDys1AQBG@UNlnTtOQ3095F@yOXosTEdmlhUCpkyQv8kCnuQbKabz6pJiEhQnkhVIlTXKePu4QQB752454b37hx341v3fjOjX03vtd48Q0)
[Answer]
# [J](http://jsoftware.com/), 82 71 bytes
```
[:(-:|:)@(*+/)@(=[:+/@(*]=&|[:<./"1|+_*0&=)]*"2(%|)=/~(%|)@1j1^i.@8)-/~
```
[Try it online!](https://tio.run/##tZNdS8MwFIbv8yvOqjZNuybtLsQdDQSEgeDNEe9KHSIrswiCqxdC6V@v7dC66draTQn5eMlJ8vCek7ScjjCMT0c45ZxZkiegETiMIQCsui/h8uZ6Vkbo@JijMI7rqWrUEXqqErG28wgvpLLC3Ju7ga1F7FoT5yQXWhX1ZMI0vHuU5kz4qigFyxarTEuIEBYPy2eT1CvnOJXKHOGVNGMBXPICfWlz4OdyPmGsDgQ@u39avfH1@RouYBK2Woumnv1NTU08NbotnpjoZPm8i3759mFafJh0@/KaLSuX1iqBKqeDDevXtDdkH8vQZB1i2DBfaBDbf7LQ3kU9lIW@FXxXDugPfKCOD7aLhb5qhm0qanK26y1q@ezb9/1gKd8B "J – Try It Online")
Takes input as a list of complex numbers.
We'll consider this example:
```
3 . . . . . . 3
. . . . . . . .
. 1 . . . . 1 .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
3 . . . . . . 3
```
which in complex numbers is `0j0 0j7 7j0 7j7 2j1 2j6`.
* `-/~` Table of differences:
```
  0 0j_7   _7 _7j_7 _2j_1 _2j_6
0j7    0 _7j7    _7  _2j6  _2j1
  7 7j_7    0  0j_7  5j_1  5j_6
7j7    7  0j7     0   5j6   5j1
2j1 2j_6 _5j1 _5j_6     0  0j_5
2j6 2j_1 _5j6 _5j_1   0j5     0
```
* `(%|)` Each of these differences divided by their magnitude, ie, as unit lengths. Pieces can attack each other only if these normalized vectors are equal to one of the 8 evenly spaced unit vectors:
[![unit vectors](https://i.stack.imgur.com/925Uk.png)](https://i.stack.imgur.com/925Uk.png)
* `=/~(%|)@1j1^i.@8` So, create a 3d table showing where each of the normalized vectors of the difference table is equal to each of the 8 "compass" unit vectors:
```
0 0 0 0 0 0
0 0 0 0 0 0
1 0 0 0 0 0   Differences that point E
0 1 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0  NE
1 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
1 0 0 0 0 0
0 0 0 0 0 0  N
0 0 1 0 0 0
0 0 0 0 0 0
0 0 0 0 1 0
0 0 0 0 0 0
0 0 1 0 0 0
0 0 0 0 0 0  NW
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 0 0  W
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 1 0 0
0 0 0 0 0 0
0 0 0 0 0 0  SW
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 1 0 0 0 0
0 0 0 0 0 0
0 0 0 1 0 0  S
0 0 0 0 0 0
0 0 0 0 0 1
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 1 0 0 0 0  SE
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
```
* `]*"2` Use these as as filters for the original input:
```
0    0    0     0   0    0
0    0    0     0   0    0
7    0    0     0   0    0
0    7    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
7j7  0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0j7  0    0     0   0    0
0    0    0     0   0    0
0    0  0j7     0   0    0
0    0    0     0   0    0
0    0    0     0 0j5    0
0    0    0     0   0    0
0    0 _7j7     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0   _7     0   0    0
0    0    0    _7   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0 _7j_7   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0 0j_7    0     0   0    0
0    0    0     0   0    0
0    0    0  0j_7   0    0
0    0    0     0   0    0
0    0    0     0   0 0j_5
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0 7j_7    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
0    0    0     0   0    0
```
* The problem now is that only the shortest positive distance in each
direction counts, because the others are blocked by the first piece. The
next series of steps filters these blocked pieces.
* `(=[:+/@(*]=&|[:<./"1|+_*0&=)` Ignoring zeros, take the min of each row (using norm for comparison), and keep only entries equal to that min. These are attackable queens. Then sum the planes, which are guaranteed not to overlap, and check where those equal the normalized differences. This is adjanceny matrix of connected queens:
```
1 1 0 0 1 1
1 1 0 0 1 1
0 0 1 1 0 0
0 0 1 1 0 0
1 1 0 0 1 1
1 1 0 0 1 1
```
* `(-:|:)@(*+/)@` Multiply the rows by the column sums, and check if the matrix is symmetric around the main diagonal:
```
4 4 0 0 4 4
4 4 0 0 4 4
0 0 2 2 0 0
0 0 2 2 0 0
4 4 0 0 4 4
4 4 0 0 4 4
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 30 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-4 thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen) (remove an effectively redundant filter of the "direction" `[0,0]`, which also means there's no need to get the threatening queen separately.)
```
+8RĖ×Ɱ2Ż’p`¤¤f€ZḢ
ŒṪç€iƇẈEɗⱮ$Ạ
```
A monadic Link that accepts a list of lists of `1`s (queens) and `0`s (not queens) that yields `1` if there is a peaceful standoff or `0` if not.
**[Try it online!](https://tio.run/##y0rNyan8/1/bIujItMPTH21cZ3R096OGmQUJh5YcWpL2qGlN1MMdi7iOTnq4c9Xh5UBu5rH2h7s6XE@ClKo83LXg////0dEGOigwlksHm5AhNlWG2DQaYmo0xGe8IbqQIUhVLAA "Jelly – Try It Online")** Or see the [test-suite](https://tio.run/##y0rNyan8/1/bIujItMPTH21cZ3R096OGmQUJh5YcWpL2qGlN1MMdi7iOTnq4c9Xh5UBu5rH2h7s6XE@ClKo83LXg/8PdWx7u2ASUcQNi/4c7mg63cx2d/HDn4keN@w5tO7TtcDtQ/P9/PQUUyIWdH0hAHpkfCFcfCOfjUh/IhceAQCItpIxPcwvo5oBA6jqA1DincQgEkuQgqjsgkOxcQJQDAtGyBb4gDqSCj9Htw@qAQEQ64ELmBcKjBJsFgTjKAVTz0OwDAA "Jelly – Try It Online").
### How?
```
+8RĖ×Ɱ2Ż’p`¤¤f€ZḢ - Helper Link = get queen & threatened queens(
                      queen coordinate, Q;
                      all queen coordinates, A
                    ):
            ¤     - nilad followed by links as a nilad:
 8                -   eight
  R               -   range -> [1,...,7,8]
   Ė              -   enumerate -> [[1,1],...,[7,7],[8,8]]
           ¤      -   nilad followed by links as a nilad:
      2           -     two
       Ż          -     zero-range -> [0,1,2]
        ’         -     decrement -> [-1,0,1]
          `       -     use as both arguments of:
         p        -       Cartesian product -> [[-1,-1],[-1,0],[-1,1],[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1]]
     Ɱ            -   map with:
    ×             -     multiply -> [[[-1,-1],...,[-7,-7],[-8,-8]],[[-1,0],...,[-7,0],[-8,0]],[[-1,1],...,[-7,7],[-8,8]], ... ... ... ,[[1,1],...,[7,7],[8,8]]]
+                 - (Q) add (vectorises) -> nine lists of potential locations in
                                            each of the eight lines of sight
                                            in proximity order plus the direction
                                            [0,0] which will all be Q
                                            (includes off-board locations)
             f€   - for each: filter keep (A) -> nine lists (eight are possibly empty)
               Z  - transpose
                Ḣ - head -> list of threatened queens and Q herself.
ŒṪç€iƇẈEɗⱮ$Ạ - Link = is peaceful?(board):
ŒṪ           - truthy multidimensional indices -> all queen coordinates
          $  - last two links as a monad - f(all queens):
  ç€         -   call the Helper link for each queen with all queens on the right
         Ɱ   -   map (across Q in all queens) with:
        ɗ    -     last three links as a dyad - f(Helper results, Q):
     Ƈ       -       keep those for which:
    i        -         first 1-indexed index of Q or 0 if not found
      Ẉ      -       length of each
       E     -       all equal?
           Ạ - all?
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 256 bytes
```
#define A(c)for(i=0;i<64;++i)for(m=j=0;j<64;++j)if(j-i&&b[i]>0&b[j]>0){x=i/8-j/8,y=i%8-j%8;t=0;x||(t=(y>0)+1);y||(t=(x>0)*4+4);abs(x)-abs(y)||(t=16<<((x>0)+(y>0)*2));if(t&&!(m&t)){c;}}
f(b,i,j,m,t,y,x)int*b;{A(b[i]++;m|=t)A(if(b[i]-b[j])return 0)return 1;}
```
[Try it online!](https://tio.run/##1ZVRb4IwEMef4VPcXCQ9W6IsxpjULvFzOB8EZWkTcGFdAkE@Ozswe9lcJm46TS659uj/7n5tgch/jqK6vl9vYp1uYM4ijLcZ02ok9WwylpzrNpAoQyGzDxnUMTO@9rxwoZePI3KGHJa50sOpb4ZTUSjdp1F/Ki3p8t2OWcUKWsMDlMV@mtN0MOZjlKvwleXoN67A9mEwmc1Yu4K3ssEDoqSq1vPuWOJZxDKSVeXGLBRaGJEIKwqRo07tIJTlnDWdcS6TnbI4Z6RsAn7TKGYb@5alMPoYBLKqSQfJSqcMS9d1Stdxmki4XWXrxRIUlH4gTjM4VfgpA3xJCB0yVJKQXjKCilmvv4antCeANqUBpJ11naorNRzq7crs76lvwW6AGm6HGq4R9n/OGq7lTb8cNZznG35Jauh@J@FyF/iHKnAe6oP/UPj@sKBL83B0iV9Ru5VbvwM "C (gcc) – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 70 bytes
```
Ｅ⁸Ｓ≔Ｅ⁸Ｅ⁸⟦⟧ηＦ⁸Ｆ⁸Ｆ⁸«Ｊικ≔⌕ＡＫＤ⁸✳λQθ¿∧№θ⁰⌈θ«Ｍ§θ¹✳λ⊞§§ηⅈⅉ§§ηικ»»⎚⬤η⬤ι⬤λ⁼ＬνＬλ
```
[Try it online!](https://tio.run/##bVDLasMwEDxbXyFyWoFq2lsgJ5O2kNKATXtoKT0YW7FFZMkvhUDJt7u7fjQQKqQdaWd2tFJWpm3mUjMMcattD/u0hrXkO1v7/q3HVAFCiA2Luk4XdqFn@PoWQvIS6YNrOawFv8UfFrz4qn53oCU/ojCYjZ61zSNjIFbq@KhblfXaWfK8HgyZr5IVxoYq9YFDZHPYOo@NNpLfC@rkrCtfQYNd0m3B3p0URP3O5upMogdx44lOQey78k@0YCn5B9Cdn2P8h9aCHkEOF3ZhW6PSFvA0/Ry9BjUEegIj@VPjU9PBq7JFX4LF@nmLjdDYDEMSjiNhuMbJJkzCKRNSZlRM1EhexUv5cHcyvw "Charcoal – Try It Online") Link is to verbose version of code. Takes input as a list of 8 strings of 8 `Q`s and `.`s. Explanation:
```
Ｅ⁸Ｓ
```
Input the board and print it to the canvas.
```
≔Ｅ⁸Ｅ⁸⟦⟧η
```
Start with no Queens being attacked.
```
Ｆ⁸Ｆ⁸Ｆ⁸«
```
Loop over each possible direction for each possible Queen.
```
Ｊικ≔⌕ＡＫＤ⁸✳λQθ
```
Look at the pieces at the current position in the current direction.
```
¿∧№θ⁰⌈θ«
```
If there is a Queen at the current position and at least one more Queen in the current direction, then...
```
Ｍ§θ¹✳λ⊞§§ηⅈⅉ§§ηικ
```
... move to the next Queen in the current direction, and add the current Queen to the list of Queens that are attacking it.
```
»»⎚⬤η⬤ι⬤λ⁼ＬνＬλ
```
Check that all lists of Queens have elements of the same length. Example: If there are Queens at a1, a8, h1 and h8, then let the lists at those positions be denoted by `a1`, `a8`, `h1` and `h8`, then we have `a1 = [a8, h1, h8]`, `a8 = [a1, h1, h8]`, `h1 = [a1, a8, h8]` and `h8 = [a1, a8, h1]`; each list `a1`, `h8`, `h1` and `h8` contains three elements and those three elements are also all lists of three elements. (Conveniently this is also vacuously true for the squares that don't contain Queens and are therefore empty lists.)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 91 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
Jõ ïJõ
@VmA{8õ@Am*XÃ®íX'+Ãfe_>J©Z<8Ã£g$...$X
U=Ë£X©[EY]gW md x
Ëe@!Xª[EY]gW me_¥XªZ¥0Ãe}Ãe
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=Ckr1IO9K9QpAVm1Bezj1QEFtKljDru1YJyvDZmVfPkqpWjw4w6NnJC4uLiRYClU9y6NYqVtFWV1nVyBtZCB4CstlQCFYqltFWV1nVyBtZV%2blWKpapTDDZX3DZQ&input=WwpbMSwwLDAsMCwwLDAsMCwxXQpbMCwwLDAsMCwwLDAsMCwwXQpbMCwwLDAsMCwwLDAsMCwwXQpbMCwwLDAsMCwwLDAsMCwwXQpbMCwwLDAsMCwwLDAsMCwwXQpbMCwwLDAsMCwwLDAsMCwwXQpbMCwwLDAsMCwwLDAsMCwwXQpbMSwwLDAsMCwwLDAsMCwxXQpdLVE)
Note that there should be an additional empty line in front of the code, but it's not displaying here. Takes input as a 2D array with Queens as `1` and empty spaces as `0`.
This is probably the worst Japt code I've ever written and I am certain there are a lot of improvements to make.
### Explanation
The first line is blank, because Japt automatically stores the result of each line in a variable. If the first line is not blank then its result would overwrite the input
```
            # Implicitly store input as U
```
The second line generates the 8 direction vectors a queen can move in, as well as `[0,0]` i.e. "not moving" which is unnecessary but ends up not mattering
```
Jõ ïJõ
Jõ     # The range [-1...1]
   ï   # Get every possible pair with:
    Jõ #  The range [-1...1] again
       # Store as V
```
The third line does the bulk of the work here. It declares a function which takes a pair of coordinates as input, and returns an array indicating the cells in U which are in each of the 9 "directions" relative to those coordinates.
```
@VmA{8õ@Am*XÃ®íX'+Ãfe_>J©Z<8Ã£g$...$X
@                                     # Declare a function:
 VmA{             Ã                   #  For each direction:
     8õ@Am*XÃ®íX'+                    #  (Get the coordinates for 8 cells in that direction) 
     8õ@    Ã                         #   For each value X in the range [1...8]
        Am*X                          #    Multiply the direction vector by X
             ®                        #   For each resulting pair:
              íX'+                    #    Add the input coordinates
                   fe_>J©Z<8Ã         #  (Remove out-of-bounds coordinates)
                   f                  #   Keep only coordinates which where:
                    e_      Ã         #    Both parts:
                      >J              #     Are greater than -1
                        ©             #     And
                         Z<8          #     Are less than 8
                             £g$...$X #  (Get the values from U at those coordinates)
                             £        #   For each remaining coordinates X:
                              g       #    Get the value from U at:
                               $...$X #     Multi-dimensional coordinates X
```
The fourth line calls V on every pair of coordinates that has a queen, counts the number of directions which see another queen, then saves that count back in the same cell of U. Technically the number saved is 1 higher than the threat number since one of the directions is "don't move" but it doesn't affect anything.
```
U=Ë£X©[EY]gW md x
  Ë£              # For every cell X in U:
    X©            #  Return 0 if X is 0
      [EY]gW      #  Otherwise call W on the coordinates of X
             m    #  For each direction:
              d   #   True if there are any queens
                x #  Count the number of true directions
U=                # Save the results back into U
```
The fifth line uses W again to get the sightlines, then checks that every cell's sightlines only contain empty spaces and other queens with the same threat number.
```
Ëe@!Xª[EY]gW me_¥XªZ¥0Ãe}Ãe
Ë                        Ã  # For every row D of U:
 e@                     }   #  True if every cell X in that row returns true:
   !Xª                      #   Return true if X is 0
      [EY]gW                #   Otherwise call W on the coordinates of X
             m              #   For each direction:
              e_      Ã     #    True if every cell Z in that direction returns true: 
                ¥X          #     Z == X
                  ª         #     Or
                   Z¥0      #     Z == 0
                       e    #   Return true if every direction returned true
                          e # Output true if every row returned true
```
[Answer]
# Java 10, ~~248~~ ~~246~~ ~~241~~ ~~239~~ ~~237~~ ~~219~~ 217 bytes
```
b->{boolean r=1>1,B;for(int m[]=new int[64],f=2,i,d,X,Y;f-->0;)for(i=64;i-->0;)for(d=9;b[i]&d-->0;m[i]+=B&&b[Y+=X*8]?f:0,r|=f<1&B&&m[i]!=m[Y])for(X=i/8,Y=i%8;(B=~(X+=d/3-1)%9<0&~(Y+=d%3-1)%9<0)&&!b[X*8+Y];);return!r;}
```
Inspired by [*@Arnauld*'s JavaScript answer](https://codegolf.stackexchange.com/a/253415/52210).  
-20 bytes thanks to *@ceilingcat*.
Input as a flat boolean-array.
[Try it online.](https://tio.run/##7Vhdb5swFH3Pr3CQgqBAPrqqonGcSnmYtId2mtqHIMQDn5s7MJExnaqM/vXMEEijtUxZknZJBw8I@9rH91wf2/je2fe2dud9X7ihnSTgysZk3gIAE@bTwHZ9cJ0XAXDiOPRtAlyp/DItR4bclLX4K2E2wy64BgQtHG08r1pTNBgP1AkMYipxSBCZFiL@jxzePD@z1ACdqlj11KlqwEDTxn0oF03R@RnET2UPXUDHxJboFXUR/1TQRBQd01DQ9ES3LoNhX6U/UTAaiLw@b9BGkWlYRfcpwj1dNRDu6FCaoEdpqiCv90EbyJ2LUV98lDiK16nKsii2HZOjKoYFZUh9llLSpjBbwJzqLHVCTrVkfB9jD0Q8aNINo5h8NS1bXgas1wMf7TDxH4ZFkfkJk3Lqq/DNg9ysbv4ucF54Xg8HMJoekj@74Kxzec5rvWZznNfmVYyVFcvsDRRUF6HnjI9r5v97nEpBfEu6pSn7dsxbUoNzQIJqFLQ3nLpjpVFQ8zvzr39DGgXtD2c5b@9JiY2CDuMK816vZsepoM3352XLQzg1Nr8EN3tQHc5fzvsbK@jPiY/tFFS3erfzZ18ztguvXdJDu8d5KwWtZ2GLnGQhqJWYACazlJWZyZuHhPlRN05Zd0YxYSGRhE@5fQiEUo5VvtZFfeiOdOgqStn5yUa5jXIb5bYVl9@xpWJg0z3RFWpdCl@EodCtBnnRk9KW1Xr6OWVLV4ECSNddDiCX3eoAs1a2@AU)
**Explanation:**
```
b->{                       // Method with boolean-array parameter & boolean return
  boolean r=0>1,           //  Result-boolean, starting at false
          B;               //  Flag whether we're still in boundary
  for(int m[]=new int[64], //  Array to keep track of queen's thread levels
      f=2,                 //  Flag-integer
      i,                   //  Index-integer
      d,                   //  Direction-integer
      X,Y;                 //  X,Y-coordinate integers of a taken direction of a queen
      f-->0;)              //  Loop `f` in the range (2,0]:
    for(i=64;i-->0;)       //   Inner loop `i` in the range (64,0]:
      for(d=9;b[i]&        //    If the `i`'th cell contains a queen:
               d-->0       //     Inner loop `d` in the range (9,0]:
          ;                //       After every iteration of loop `d`:
           m[i]+=          //        Increase the current `i`'th threat value by:
            B              //          If we're still in bounds,
            &&b[Y+=X*8]?   //          and `X,Y` contains a threatening† queen:
             f             //           Increase it by the flag (1 in the first
                           //           iteration, 0 in the second)
            :              //          Else:
             0,            //           Leave it unchanged by increasing with 0
           r|=             //        Also update the result to:
              f<1          //         If this is the first iteration
              &B           //         And we're still in bounds:
              &&m[i]!=m[Y])//          Check whether the `i` and `X,Y` threat-levels
                           //          are NOT the same
        for(X=i/8,Y=i%8;   //      (Re)set `X,Y` based on `i`
            (B=~(X+=d/3-1) //      Go to the next `X`-coordinate based on `d`
                 %9<0      //      And check if it's still in bounds
               &~(Y+=d%3-1)%9<0)
                           //      Do the same for the `Y`-coordinate
            &&             //      And if we're still in bound:
              !b[X*8+Y];); //       Stop the inner-most loop if we've encountered a
                           //       threatening† queen
  return!r;}               //  Finally: return the inverse of result `r`
```
*†*: Because we don't skip direction `d=4` (which means `x,y==X,Y`), every queen will have a tread-level one higher than in the challenge description, because it'll increase for its own position (a.k.a. every queen 'threatens' itself). But since this is done for *each* individual queen, it won't matter for the final output.
[Answer]
# [Raku](https://raku.org/), 122 bytes
```
{my%x=@^q.map:{$^q=>map {first(@q.any,($q,*+$^d...*)[1..7])//|()},((-1,0,1)X+(-i,0,i))};[&&] %x{*}.map:{[==] @^v,|%x{@v}}}
```
[Try it online!](https://tio.run/##bVBdj4IwEHz3V2yMSmtLBRS4nAfhL9ybCYGEi5A0OVTwIxjsb@e6FN/uoZPNzOzsdi9l@xsM9RNWFURDXz@XXZTkjaiLy2e/yJso1hX0lWyvN5I0ojg9OVk0fM0W@VEIsaapK0SY0c3mRajihNgud7hLD4zYUleSUrVPV6sMll2/ViY4jaIMkvzBX5pMHkqpoTq38OUyV4LLPAlbA76EAKuQOTLmaAiQ1uBr0Ayh@vlsKzkd5a2R0ethN0aYRg@TJ2aMR9rRueCwECeEZoxxBVPf/4Z3lvfeZPSbVX38g4cw/sFjOwk7VHHLGOwYkuZelqcr9DMAffnk51y0R4ggtYQFXQcf2Yh7LRstDcEGIessFW2Zaaf1bQEebEpCp7jcbyP3Mj0cKjLJ@jLz@X6mZsMf "Perl 6 – Try It Online")
Input is a list of complex numbers, the queen coordinates.
* `my %x = @^q.map: { $^q => ... }` generates a hash from each queen to a list of the other queens that it threatens, storing it in the variable `%x`.
* `(-1, 0, 1) X+ (-i, 0, i)` crosses the real numbers -1, 0, and 1 with the complex numbers -i, 0, and i with addition, producing the nine complex numbers -1-i, -1, -1+i, -i, 0, i, 1-i, 1, and 1+i. These are the steps that will be followed from each queen, looking for another queen that it threatens. For brevity, we don't omit the step 0, so each queen will count as attacking itself. That doesn't change the final boolean answer.
* `first(@q.any, ($q, * + $^d ... *)[1..7]) // |()` takes up to seven steps from each queen, stopping when it encounters one of the other queens. `first` returns `Nil` if it doesn't find anything, so the `// |()` converts that into a Slip object, which doesn't leave anything in the output list.
* `[&&] %x{*}.map: { [==] @^v, |%x{@v} }` checks that each hash value `@^v` (that is, each list of threatened queens) satisfies the condition that its size is equal to the sizes of every other list of queens threatened by those queens.
]