[Question]
  [
*[Not a duplicate of the valid move challenge because that asks for specific pieces](https://codegolf.stackexchange.com/questions/148587/is-it-a-valid-chess-move)*.
## Backstory
The other night I was doing [a little trolling](https://chat.stackexchange.com/rooms/145373/conversation/plausible-chess) with ChatGPT and chess. I was trying to get it to call me out for making illegal moves, as a lot of the time, you can feed it whatever nonsense you want. While doing so, I wondered if it didn't recognise invalid moves because they were technically valid under some board arrangement. I then thought I'd make a code golf challenge.
## The Challenge
Given a start and end square on an 8x8 chess board, determine whether the move is possible on any legal chess board.
Alternatively, can any kind of piece make a move from the start square to the end square.
## Chess Pieces
For this challenge, you only need to know how the knight and queen move. King and pawn moves can be considered equivalent to a queen moving a single square. A rook move is a queen move restricted to vertical and horizontal movement. A bishop move is a queen move restricted to diagonal movement. Castling and En Passant (holy hell) aren't relevant either.
A valid move from the square highlighted in red is any square marked with a green circle:
![](https://i.stack.imgur.com/cwAYw.png)
This includes the vertical, horizontal and diagonal movement of the queen, as well as the L-shaped movement of the knight.
## Rules
* The positions will be given in algebraic chess notation (letter then number of the square).
* The start and end squares will never be the same square.
* The start and end squares will always be valid squares on an 8x8 chess board.
* Positions can be given in any reasonable and convenient format, including:
	+ Strings (e.g. `["f4", "b8"]`)
	+ A list of strings (e.g. `[["f", "4"], ["b", "8"]]`)
	+ A list of numbers that represent the character codes of each string item (e.g. `[[102, 52], [98, 56]]`)
	+ A string, number pairs (e.g. `[["f", 4], ["b", 8]]`)
	+ A list of row/column pairs (e.g `[[5, 3], [1, 7]]` OR `[[6, 4], [2, 8]]`). Can be 0-indexed or 1-indexed. Your choice.
* Output in any reasonable and convenient format.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so make sure your answer is as short as possible.
## Test Cases
```
start, end -> plausible?
a1, a4 -> True
b2, d3 -> True
b2, e3 -> False
b2, c3 -> True
a1, h8 -> True
c7, g3 -> True
c7, g2 -> False
```
  
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 24 bytes
```
@(a,b)imag((a-b)**4)<28i
```
[Try it online!](https://tio.run/##bZDbCoJAEIbv9ykGr3ZtFXYTFDvQVU/QXUSMuprSCXcLIXx2W43Iorn85uOfn7mkBu@qyxe@73crijxh5QkLStFLmOsGbC6jsjNKm32KWmlYgDXJ1kHBAQPwlrCpb8ohTiI5ZNMfoAawxqN@k3Ss9CGHaATSkEMx/QXyE7IjJL/UUNkeIg4J2Ok7aVPr67E09NOUVjxmbDYoTa88BBctFbFknj3svDZoNw0VbNJQydzyW5ftyEz@mfnwMd7LQUvUObPluic "Octave – Try It Online")
Takes two complex numbers as inputs.
## How?
Port of @xnor's python answer plus a trick or two by myself.
Trick 1:
@xnor's test polynomial a^3b-b^3a times 4i is the imaginary part of (a+ib)^4 = a^4 + 4i a^3b - 6a^2b^2 - 4i ab^3 + b^4
*Note:* a and b here as defined in @xnor's code; in my code they have a slightly different meaning.
Trick 2:
Octave implicitly takes absolute values before comparing complex numbers. We abuse that by comparing to 28i instead of 28 to save an explicit call to abs.
[Answer]
# [Python 2](https://docs.python.org/2/), 29 bytes
```
lambda a,b:abs((a-b)**4%1)<28
```
[Try it online!](https://tio.run/##VY/BboMwEETv/ooVUoWXmiqGSI1Q0mO/oDdiVQuYxBUBgmml5uepISkkPlj7xjPyTvvbH5s6GsrdfqjolBUEJLKEMss5hRkGwfpJ4jbaDGfYwc1xSXjTFfySrhSG4@STjwKumvzXpI/IWK9t/5mT1dblU37m5sW2lek5unSahM4u7sWR9Q9Vd1KsEKFsOjBgavA8j6QAWkP4Bh/dt2ZZJKCIH1BP@E6VvXK@PI/h42bG/FXAIX7EaA67z25rePvaQ8VY25m650srZPNmi5gwcGeyQsnN2HSlnuVXMI1SCeOuWZJqag0mjdTwBw "Python 2 – Try It Online")
Based on @xnor's answer. Takes two complex numbers as input.
# [Python 2](https://docs.python.org/2/), 42 bytes
```
lambda x,y,X,Y:abs((X-x+1j*(Y-y))**4%1)<28
```
[Try it online!](https://tio.run/##VY/NboMwEITvfoqVpQovNVUMkRqhpsc@QQ@JiFWZv8YVBYJpFfLy1BAKiS/rbzwj79Rde6xKv8@3h75Q33Gq4Mw7vuP7UMWGsZ13fhRfLtt7HaLrrh8Evvib/gRbmOyXkFVNyi7RSqI33BzlIIerJv414SAS0mam/UiUyYzNR@zE9JOpC90ytOko9Kyd34oDZ7@quJECiQh51YAGXQKlVAkOag3eK7w3PxmJfQ5pcIfZiG@qMFdOluchfNzMmDxz@Azu0Z/D9rNpDXooKUpC6kaXLVtaIZk3W8SQgD2jFXKmh6YryccphikmFnLsCzryZf8H "Python 2 – Try It Online")
The same with less opportunistic input format (4 integers).
## How?
Recall that in polar coordinates complex multiplication adds angles.
Therefore all queen-like moves (and only those) when taken to 4th power will end up on the real axis, i.e. have vanishing imaginary part.
Explicitly, if the difference of source and destination is \$x+yi\$ then the imaginary part of its fourth power is \$4 \times \left( x^3y - x y^3\right)\$ which happens to be @xnor's test polynomial (up to the prefactor 4). As observed by @xnor this has absolute value (4x) 6 at knight's moves and greater for all other (non-queen) moves.
Implementation detail: In Python 2 but not 3 the imaginary part can be isolated by `%1`.
[Answer]
# [Python 3](https://docs.python.org/3.8/), 47 bytes
```
lambda x,y,X,Y:-7<(a:=X-x)*(b:=Y-y)*(a*a-b*b)<7
```
[Try it online!](https://tio.run/##VY/NboMwEITvfooVF7zIrgpUIrJCj32CHhIRVC1/jSXKf6vAy1NTUlB8sGbG/uydZhyudeUfmm4uwstc0leSEdzEKE7irGRw5KTCk7yhwxMVnuVoBDkkEyfBYzC3EMKdmRSvu4xP0XOMclE22Shgzdz/zLURGRvyfvhIqc97w0e85XxSoX7qm1IPHNE8ESlpGNGurMh/qDTSjxGhqDvQoCuwLItcAfQC8hXeu@@cJZ6AzH@w@Z99o7JffbofL/D1sNk0EPDpP1pvg81n9/msS2VhzFjT6WrgexVk22R7qBiYtV4tuKNNNWH2pRPoyItx/gU "Python 3.8 (pre-release) – Try It Online")
Test cases [from mousetail](https://codegolf.stackexchange.com/a/260303/20260).
**[Python 2](https://docs.python.org/2/), 49 bytes**
```
lambda x,y,X,Y:-7<(X-x)**3*(Y-y)-(X-x)*(Y-y)**3<7
```
[Try it online!](https://tio.run/##VY9NboMwEIX3PsWIDR5kVzFUIkJJlz1BF4mIVTlgGksUCNAq5PLU/BQSb2a@53maeVXXXsrC77P9qc/V9zlVcGMdO7BjxMMdPfAbel7g0SPvkE849lbchf0V9jC77hEt65Te441EPnSucpHBpIl/TbiIhLS6aT8T1ejG@mN6pealqXLTUrTuOOJ2nD2KA@tflT9IgUSErKzBgCnAcRwlGKhX4G/wUf9ocvYZpMET6hHfVd5MnKzfg/myXTAJGXwFz@gvZrtsPsM5FQ5KQqraFC1dUyFZLlvFiIB94yhk1AxJN5KNVQxVzCzkmBdM7Mv@Dw "Python 2 – Try It Online")
No walrus here.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~12~~ 8 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
αDËsP3‹~
```
-4 bytes porting [*AndrovT*'s Vyxal answer](https://codegolf.stackexchange.com/a/260309/52210).
Input as two pairs of codepoints.
[Try it online](https://tio.run/##yy9OTMpM/f//3EaXw93FAcaPGnbW/f8fbWhgpGNqFMsVbWmhY2oWCwA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9W6WL/qGGegob9o6Y1h9td7JU0FR61TVJQsk/4f26jy@Hu4gDjRw076/7r/I@OVko0VNJRSjRRitWJVkoyArJTjBHsVCR2MoQNVp9hAWYnmwPZ6cZIbCMwO80EyE4CqokFAA) or [verify every single pair of chessboard positions](https://tio.run/##yy9OTMpM/e9ocWjxkcbDi7z0DrcdnnBu66OmNYfbE/6f2@hyuLs4wPhRw866/7WHVh7uV3LMyVEoKSotyahUSM5ILS5Oyk8sSlEoyC/OLMnMz1MoSMwsKrZSUNLRObTNnuvQuniolrTEnOJUAlrs/wMA).
**Original 12 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage) answer:**  
Port of [*@Arnauld*'s JavaScript answer](https://codegolf.stackexchange.com/a/260305/52210).
```
αW_snDO5QsËM
```
Input as two pairs of codepoints.
[Try it online](https://tio.run/##yy9OTMpM/f//3Mbw@OI8F3/TwOLD3b7//0cbGhjpmBrFckVbWuiYmsUCAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9W6WL/qGGegob9o6Y1h9td7JU0FR61TVJQsk/4f25jeHxxnou/aWDx4W7f/zqaMf@jo5USDZV0lBJNlGJ1opWSjIDsFGMEOxWJnQxhg9VnWIDZyeZAdroxEtsIzE4zAbKTgGpiAQ) or [verify every single pair of chessboard positions](https://tio.run/##yy9OTMpM/e9ocWjxkcbDi7z0DrcdnnBu66OmNYfbE/6f2xgeX5zncri72N800Pd/7aGVh/uVHHNyFEqKSksyKhWSM1KLi5PyE4tSFAryizNLMvPzFAoSM4uKrRSUdHQObbPnOrQuHqolLTGnOJWAFvv/AA).
**Explanation:**
```
              #  first input ("f4"): [102,52]; second input ("b8"): [98,56]
α             # Absolute difference of the values in the two (implicit) input-pairs
              #  [abs(98-102),abs(56-52)] → STACK: [4,4]
 D            # Duplicate the pair
              #  STACK: [4,4],[4,4]
  Ë           # Check if the values in the pair are the same
              #  STACK: [4,4],1
   s          # Swap so the pair is at the top of the stack again
              #  STACK: 1,[4,4]
    P         # Take the product of the pair
              #  STACK: 1,16
     3‹       # Check whether this is smaller than 3 (thus 0, 1 or 2)
              #  STACK: 1,0
       ~      # Bitwise-OR to check either of the two is truthy
              #  STACK: 1
              # (after which the top of the stack is output implicitly as result)
```
```
              #  first input ("f4"): [102,52]; second input ("b8"): [98,56]
α             # Absolute difference of the values in the two (implicit) input-pairs
              #  [abs(98-102),abs(56-52)] → STACK: [4,4]
 W            # Get the minimum (without popping)
              #  STACK: [4,4],4
  _           # Check if this minimum is 0 (1 if 0; 0 otherwise)
              #  STACK: [4,4],0
   s          # Swap so the earlier pair is at the top again
              #  STACK: 0,[4,4]
    n         # Take the square of both values
              #  STACK: 0,[16,16]
     D        # Duplicate this pair
              #  STACK: 0,[16,16],[16,16]
      O       # Sum the copy
              #  STACK: 0,[16,16],32
       5Q     # Check whether this sum is equal to 5 (1 if 5; 0 otherwise)
              #  STACK: 0,[16,16],0
         s    # Swap so the earlier squared pair is at the top again
              #  STACK: 0,0,[16,16]
          Ë   # Check whether both values in the pair are the same
              #  STACK: 0,0,1
           M  # Push the largest value on the stack, to check if any is truthy
              #  STACK: 0,0,1,1
              # (after which the top of the stack is output implicitly as result)
```
[Answer]
# JavaScript (ES6), 42 bytes
Expects `(x0,y0,x1,y1)`, where all arguments are integers. They can be 0-indexed coordinates, 1-indexed coordinates or ASCII codes.
Returns a Boolean value.
```
(x,y,X,Y)=>!((x-=X)*x+(y-=Y)*y-5&&x/y^y/x)
```
[Try it online!](https://tio.run/##dc9Ra8IwEADg9/6KWx/k4i7p1A0dEmGM7RfsQSkZpLG1G8Vo4yT59V1KYTI27yE57svluE991s60H4cT39tt2VWyQ0@B1rRhcnWD6Llcs7G/xcDlho0DfxiNfBbeQ@ZZ544gwYFcQQ5OmFq3z/GTpxPeMeDwOCdYxNvlEwVqmeQJxHepnqQUz/sUFEGWwVv7VQ5STHvZzq5J@SOvunG/yPzTNAyqF3/FzHvZza7KNApcBqlEVLZ90aZGzDVBoVi/tLF7Z5tSNHaHfZWgQiGEO6JmBENWsBjdNw "JavaScript (Node.js) – Try It Online")
### Commented
```
(                //
  x, y,          // (x, y) = coordinates of source square
  X, Y           // (X, Y) = coordinates of target square
) =>             //
!(               //
  (x -= X) * x + // we compute x = x - X and y = y - Y
  (y -= Y) * y   // if the squared Euclidean distance x² + y²
  - 5            // is not equal to 5, this is not a knight move
  &&             //
  x / y ^ y / x  // we compute x / y and y / x
                 // XOR'ing both terms together gives 0 if:
                 // - either x = 0 or y = 0 (rook move), in which case one
                 //   of the terms is ±infinity and the other one is 0
                 //   (see note below)
                 // - x = ±y (bishop move), in which case both terms are
)                //   equal
```
### Note
According to the ECMAScript specification of [NumberBitwiseOp(*op*, *x*, *y*)](https://262.ecma-international.org/12.0/#sec-numberbitwiseop), the arguments of a bitwise operation are first converted with the abstract operation [ToInt32(*argument*)](https://262.ecma-international.org/12.0/#sec-toint32) whose first two steps are:
> 
> 1. Let *number* be ? ToNumber(*argument*).
> 2. If *number* is \$\text{NaN}\$, \$+0\_\mathbb{F}\$, \$-0\_\mathbb{F}\$, \$+\infty\_\mathbb{F}\$, or \$-\infty\_\mathbb{F}\$, return \$+0\_\mathbb{F}\$.
> 
> 
> 
That's why `±infinity ^ 0` is `0`.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~7~~ 6 bytes
```
εꜝ2v∴≈
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJ+IiwiIiwizrXqnJ0yduKItOKJiCIsIiIsIlsxLCAxXSwgWzEsIDRdIC0+IDFcblsyLCAyXSwgWzQsIDNdIC0+IDFcblsyLCAyXSwgWzUsIDNdIC0+IDBcblsyLCAyXSwgWzMsIDNdIC0+IDFcblsxLCAxXSwgWzgsIDhdIC0+IDFcblszLCA3XSwgWzcsIDNdIC0+IDFcblszLCA3XSwgWzcsIDJdIC0+IDAiXQ==)
*-1 byte by @Johnathan Allan*
Takes input as two pairs of numbers.
```
εꜝ2v∴≈
ε      # absolute difference
 ꜝ     # keep truthy
  2v∴  # vectorized maximum with 2
     ≈ # are all equal?
```
[Answer]
# T-SQL, 63 bytes
input is a table
```
SELECT 1/~((a-c)*(b-d)/3*(a-c)*(b-d)*(abs(a-c)-abs(b-d)))FROM @
```
**[Try it online](https://dbfiddle.uk/UcRETwri)**
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ạḟ0»2E
```
A dyadic Link that accepts one cell reference on the left and the other on the right, each as a pair of integers\* and yields `1` if plausible or `0` if not.
\* The indexing of the inputs does not matter so long as it is unscaled and the two pairs use consistent indexing; they could also be the ordinals of the characters (since only files and ranks, individually, need to have equivalent indexing).
**[Try it online!](https://tio.run/##y0rNyan8///hroUPd8w3OLTbyPX////Rxjrmsf@jTXWMYgE "Jelly – Try It Online")** Or see the [test-suite](https://tio.run/##y0rNyan8///hroUPd8w3OLTbyPX/w91bDm19uGOT/@Hl@o8ad@hkPWqYo2Brp/CoYa5m5P//iYYKiSZcSUYKKcYgMhVMJhtzAcUzLLiSzRXSjcGkEQA "Jelly – Try It Online").
### How?
```
ạḟ0»2E - Link: A=[StartRow, StartFile]; B=[EndRow, EndFile]
ạ      - absolute difference (vectorises)
           -> [abs(StartRow-EndRow), abs(StartFile-EndFile)]
 ḟ0    - filter out zeros -- remove the zero from any rook move
   »2  - max with two (vectorises) -- cast king/horsey moves to 2 step queen moves
     E - all equal? -- are we left with a queen move, or < 2 elements (was a rook)?
```
[Answer]
# Excel, ~~77~~ 72 bytes
```
=LET(
    a,INDIRECT(A1&":"&B1),
    b,ROWS(a),
    c,COLUMNS(a),
    OR(b=1,c=1,b=c,b*c=6)
)
```
Expects strings (e.g. "f4", "b8") in cells `A1` and `B1`. Returns a Boolean.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 23 bytes
```
Ｆ²⊞υＮＵＭυ↔⁻ιＮ⊞υ↔↨υ±¹‹Πυ³
```
[Try it online!](https://tio.run/##XYwxDsIwEAR7XnHlWQoFDh0VUCGRKF@4OIZYcuzI5@P7JpaAgnJ3ZtfMlEwkX8ojJkCtYBCeURq4hVVyL8toEyp12nW0XuOyUJgqPY8cvWSLnQvC6P79uvg@/dwLsa1Fb5@0xcNHSy5kvFtmHFKcxGQU1UC7sVI0aDhCW/Yv/wY "Charcoal – Try It Online") Link is to verbose version of code. Takes input as four integers and outputs a Charcoal boolean, i.e. `-` for plausible, nothing if not. Explanation: Inspired by @xnor's Python answer.
```
Ｆ²⊞υＮ
```
Input the first pair of coordinates.
```
ＵＭυ↔⁻ιＮ
```
Take the absolute difference of them and the second pair of coordinates.
```
⊞υ↔↨υ±¹
```
Push the absolute difference of the two absolute differences.
```
‹Πυ³
```
Test whether the product is less than `3`.
22 bytes with some evaluate hackery to port @loopywalt's Octave answer:
```
‹↔ＵＶ⁺Ｘ↨Ｅ⁴ＮＵＶ1j⁴.imag²⁵
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMMntbhYwzGpOD@ntCRVI6CyJCM/z7UsMac0EcTNKS3WCMgvTy3ScEosTtXwTSzQMNFR8MwrKC3xK81NAoprauoooOlSMsxSAgmbALGSXmZuYjqQC2QbmWpqWv//b6RgpGCiYPxftywHAA "Charcoal – Try It Online") Link is to verbose version of code. Takes input as four integers and outputs a Charcoal boolean, i.e. `-` for plausible, nothing if not. Explanation:
```
        ⁴               Literal integer `4`
       Ｅ                Map over implicit range
         Ｎ              Next input number
      ↨                  Interpret as base
             1j          Literal string `1j`
           ＵＶ            Evaluate as Python
     Ｘ                  Raised to power
              ⁴         Literal integer `4`
    ⁺                   Concatenated with
               .imag    Literal string `.imag`
  ＵＶ                    Evaluate as Python
 ↔                      Absolute value
‹                       Is less than
                    ²⁵  Literal integer `25`
                        Implicitly print
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 67 bytes
```
(.)(.)(.)(.)
$1$*1-$3$*1,$2$*1-$4$*
(1+)-\1
^1..1$|^(1+),\1$|^,|,$
```
[Try it online!](https://tio.run/##K0otycxL/B@SEJ@TkJKgF5PCpaqREOPC9V9DTxOOuFQMVbQMdVWMgaSOihGYbaKixaVhqK2pG2PIxRVnqKdnqFITBxLQiQGxdGp0VP7/TzTUUUg0UdC1UwgpKk3lSjLSUUgxRuGmgrluiTnFEH4yQhqkOcMCzk0211FIN0blGsE1AwA "Retina 0.8.2 – Try It Online") Takes input as a string of four digits but test suite converts from test case format for convenience. Explanation:
```
(.)(.)(.)(.)
$1$*1-$3$*1,$2$*1-$4$*
```
Convert to unary, preparing to subtract the `x` and `y` coordinates from each other.
```
(1+)-\1
```
Take the absolute difference of both the `x` and `y` coordinates.
```
^1..1$|^(1+),\1$|^,|,$
```
Match either a knight move, a bishop move, or one of two possible rook moves.
[Answer]
# [Python](https://www.python.org), ~~78~~ 73 bytes
```
lambda i,j:((a:=abs(i[0]-j[0]))==(b:=abs(i[1]-j[1])))|(a<1)|(b<1)|(a<3>b)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=VVDLTsMwEBRXf8Uql9iSg3CCRGU1FSck7tzSCtl5UFchTxeJAF_CJZfyT_A1OHGaqD6sd8Y74939_qne9b4s-lMGIWxPR515q9_HXLzKRICiB46x4KGQLVbRzc47mEBIGGJ5JtlAMkOSTyzWzEQ5RrEONpJYw7-r-9rYT64dx2WT4G6w8obMFS6hYDl25phLCEI6bfVzLNq0NfoPXGPc8VBdt1WuNCbEWETcMxpaWy1N30Ru0sA0BFnZgAJVgOM4glEQt-Bt4Kk5pkj6FJLgAqYjfBB5a3G8PA_i_WqG8R2Fl-AS-rPYfDb152wLh3whVDWq0HgZhaC5s4XkCMyxpdm4bKrGiUBF_m5aZN_b-x8)
# [Python](https://www.python.org), 65 bytes
Alternate input format, credit to 97.100.97.109
```
lambda u,v,x,y:((a:=abs(u-x))==(b:=abs(v-y)))|(a<1)|(b<1)|(a<3>b)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=VVDLTsMwEBRXf8Uql-4iB5EEiSpqKsGBL-CWRshJE2op5J2oLfAlXHIp_wRfg1OHRPVhvDP2jHf99V0cml2e9acEPNic2iYxlz8PqXgLtwJa3vE9P7iIwvVEWGNr7ok8D0NNO_NARB8oVpbC8Ixi5axD0kG_V4-lih3Tji7m1RaP_m1A5lAtxII4aM3616wFEWNNXDcvkajjWvnfsUQ8up68qYtUNkikInzXVB5eai-PO5Gq0gmIIMkrkCAzMAxDWBzEHZhreK7amIU2h61zQeMzfRJprXk0Hw_m3XKi0T2HV-eS2pNZPTb2Z2wygz4ZKyqZNTiPQmzqbBZdBmrpqwleSzUaVzjMBNK3g_Er-17vfw)
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2), 9 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md)
```
-ADạsp2©|
```
Port of [AndrovT's Vyxal answer](https://codegolf.stackexchange.com/a/260309/114446).
#### Explanation
```
-ADạsp2©|  # Implicit input
-A         # Absolute difference
  D        # Duplicate
   ạ       # All are equal?
    s      # Swap
     p     # Product
      2©   # Less than or equal to 2
        |  # Logical or
           # Implicit output
```
[Answer]
# [Scala](http://www.scala-lang.org/), ~~237~~ 221 bytes
Saved 16 bytes thanks to the comment.
Golfed version. [Try it online!](https://tio.run/##fZBtS8MwEMff91McZbBkpntUHB0RxCIU9FX1lfjimj6sUrvRxNHS9rPPpNWBMg0cd//87nJ3kQJzPO7Ct1goeMSsgOao6n0MAQ9UmRWp1Suf@4WyojiBhKAbsNANKG@MlkT2MZFkTqdqp/OcMY6HiK0dSRZ0itLL0kzRbmNKDqRyfVZrE9oi19flB8yh8njliI0Ja4/XTrSpvEnlXdTeRGt@1bY6g8/bth5cTznvcWfKSMVqyiVB2ivBIqNCrQxhRndHM8G7XpRgmUoXbssS65dh11fqwnORKeDQWKCPGUXFUt2hjKW@fcikIj0BIDYubAY2XtqUwWwGT@VHfGLh0rBo9TeLv9k95vI3FGcLh4bb9Tkmrg1LV/@wpU3hZ0Nq9e604jTZlTGKLTQgtAaCDEIK/Obrqb3@JZUXRNojhFEIoyYZUjqb9imdZayzjp8)
```
type S=String
type I=Int
def f(a:S,b:S)={def s(s:S)={(s(0).toInt-'a'.toInt,8-s(1).asDigit)};def v(x:I,y:I,c:I,d:I)={val xD=x-c;val yD=y-d;xD*xD+yD*yD==5||xD==0||yD==0||xD*xD==yD*yD};val(x,y)=s(a);val(c,d)=s(b);v(x,y,c,d)}
```
Ungolfed version. [Try it online!](https://tio.run/##fVJNT8JAFLzzKyYNCbtYgRaNhAQThZiYyMmPi/HwWhZYU1vtLqQN8ttx@xmr6KHd92ZmZ7r7qnwK6HCIvFfha8xJhti1gIVY4s00jOKVGuMqjil9vtexDFcvfIzHUGpMciWwpQBaKD0lJZRB76TSLGcAZpFj2bDozOI2@n08xBtRc56bcYvh35youBsK1E/SP7qxCFyPjnH@Rcathv9wrsXRDOStfKmP2FtGsSB/jR1804ORDY9jcllaZffBEsdG6hgU6mNDsZhGUbyQIRkXRryhdI3SPa70KuW7uXkdhExZbULbQ3sn1RMFcjGPtqIMs1Fa7a1i276VPeU0f5ubuRYTNQNlt6G2YV68HitTbMB7OjIgTtGhTlHbGJlWMYf3SM3kSmr@Pab5WWPkO9KqSNwKKQqTfB1FgaCw8TclM7lcGiRxTFTi1nha4mmGpwVeaLvlelJqupV2gnN8flaOEwyyLm10TQeDNizyw@1bh8MX)
```
object Main {
  def main(args: Array[String]): Unit = {
    val testCases = List(
      ("a1", "a4"), // True
      ("b2", "d3"), // True
      ("b2", "e3"), // False
      ("b2", "c3"), // True
      ("a1", "h8"), // True
      ("c7", "g3"), // True
      ("c7", "g2")  // False
    )
    testCases.foreach { case (a, b) =>
      val (x1, y1) = squareCoordinates(a)
      val (x2, y2) = squareCoordinates(b)
      println(s"$a $b ${isValidMove(x1, y1, x2, y2)}")
    }
  }
  def squareCoordinates(s: String): (Int, Int) = {
    (s(0).toInt - 'a'.toInt, 8 - s(1).asDigit)
  }
  def isValidMove(x1: Int, y1: Int, x2: Int, y2: Int): Boolean = {
    val xDiff = x1 - x2
    val yDiff = y1 - y2
    xDiff * xDiff + yDiff * yDiff == 5 || xDiff == 0 || yDiff == 0 || xDiff * xDiff == yDiff * yDiff
  }
}
```
[Answer]
# [J](http://jsoftware.com/), 17 15 14 bytes
```
[:(=+.3>*)/|@-
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/o600bLX1jO20NPVrHHT/a3KlJmfkKxgCYZqCsYIRMtdQwUQBwjcCwjQgzxiFbwznQ9RbACGEb6xgDuSbg@SRNZjCNcAUGCn8BwA "J – Try It Online")
*Port of Neil's Charcoal / xnor's Python answers*
*Also -1 thanks to an idea from AndrovT's answer*
# [J](http://jsoftware.com/), original, 21 bytes
```
1 e.(*:^:4@*,5=|*|)@-
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DRVS9TS0rOKsTBy0dExta7RqNB10/2typSZn5CsYZhkqpCkYZxkhcw2zTBQgfKMsIyDfJMsYhW8M50PUW2RZQPnGWeZAvjlIHlmDKVwDTIGRwn8A "J – Try It Online")
*5 idea from Arnauld's answer*
For the rest, we take the difference between in the inputs as complex numbers, normalize the vector, then square it 4 times. If the original vector was on one of the compass directions (rook) or one of the diagonals (queen/bishop), it will eventually settle at 1.
We then check if the result is 1 or 5.
[Answer]
# [Nekomata](https://github.com/AlephAlpha/Nekomata) + `-e`, 7 bytes
```
-AZ‼2M≡
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m70iLzU7PzexJHFNtJJurpKOgpJuqlLsgqWlJWm6Fqt1HaMeNewx8n3UuXBJcVJyMVR8wc3WaEtzHRPLWAUQbWoUyxVtaaFjagDkGxoY6JgaoggYogpYWkL5UBMMDUx0TM1AAkAJU7CAMVQFsoABUMDQwAhkmwLYLLNYiGsA)
A port of [@Jonathan Allan's Jelly answer](https://codegolf.stackexchange.com/a/260356/9288).
```
-AZ‼2M≡
-A          Absolute difference
  Z‼        Remove zeros
    2M      Max with 2
      ≡     All equal?
```
]