[Question]
  [
Most Android smartphones allow the user to use a swipe pattern to open their phone:
[![pattern lock](https://i.stack.imgur.com/MgJJj.jpg)](https://i.stack.imgur.com/MgJJj.jpg)
Certain patterns are legitimate, and others are impossible. Given an input swipe pattern, return a truthy or falsy indicating if the given input pattern is legal or not. 
## Input
The grid is labelled row-wise 1 through 9: 
```
1 2 3   
4 5 6   
7 8 9
```
The input is a number comprised of the nodes visited from first to last. For example, the swipe pattern above is 12357.
Input can be a decimal number, string or list of numbers. It will not contain 0 because there is no node 0.
Amendment: indexing 0-8 is allowed since a lot of languages index from 0. If you use 0-8, it'll be necessary to indicate as such at the beginning of your answer and adjust the test cases accordingly.
## Rules
* Every node starts as unvisited initially and may only be visited once. Any pattern which visits a node more than once is falsy.
* A truthy pattern must contain at least one swipe, so a minimum of 2 nodes.
* It's not possible to skip over an unvisited node directly in line with another.
For example, 13 is falsy because 2 is unvisited and directly in line.
* It is only possible to skip over a visited node. 42631 is an example of this.
* Lines may cross otherwise. For example, 1524 is truthy.
* Assume node widths are insignificant and ignore practical issues (finger thickness, etc). So 16 is truthy even though it may be slightly harder to achieve in reality.
## Test Cases
```
1 -> false     
12 -> true   
13 -> false   
16 -> true  
31 -> false   
33 -> false  
137 -> false   
582 -> true  
519 -> true  
1541 -> false  
12357 -> true    
15782 -> true   
19735 -> false  
42631 -> true   
157842 -> true  
167294385 -> true   
297381645 -> false   
294381675 -> true
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the fewest number of bytes wins.
  
[Answer]
# JavaScript (ES6), 64 bytes
Takes input as an array of numbers. Falsy values are **0** or **NaN**. Truthy values are strictly positive integers.
```
a=>a[p=1]*a.every(n=>a[p=a[n&p&p*n%5<0|~(p-=n)==9&&p/2]&&-n]^=p)
```
[Try it online!](https://tio.run/##dY9NTsMwEIX3PkU2@KeaBOLYpZFqlpyAnTGSVVJoldpWUipVQlw9WDIm7aK7N9/Mm3mztyc7boZdOJbOv3fTVk1WPVkdVG0WtupO3XCmLhGrHQ44LNydXD98/9BQKseUajEO99xgXDrzpgKbNt6Nvu@q3n9Qol@Gr@Pn2RCGLrlGRaFr4AaSWCYhYZWZhBra3ObQgITHXEY5D0ZzLDm0IOLUCmTCIqJlBPW1SWTbbEgLpEEGVQcb6JZVe79zlBSEMXQVm7w6/Wz78cY/@VSTxP/xJpPYuvxCzOnaGKHJ2flfmbKJW9mmXw "JavaScript (Node.js) – Try It Online")
## How?
### Preamble
Two digits are vertically, horizontally or diagonally opposed if:
* they are both odd, different from each other and different from 5 (figure 1)
* OR they are both even and their sum is 10 (figure 2)
[![opposed digits](https://i.stack.imgur.com/GEa2y.png)](https://i.stack.imgur.com/GEa2y.png)
Besides, the digit standing between two opposed digits **n** and **p** is equal to **(n + p) / 2**.
### Formatted source code
```
a =>
  // force a falsy result if a[1] is undefined
  a[p = 1] *
  // walk through all values n in a[]
  a.every(n =>
    // access either a[-n] or a[undefined]
    a[
      // set p to either -n or undefined
      p =
        // read either a[0] or a[in_between_digit]
        a[
          n & p & p * n % 5 < 0 | ~(p -= n) == 9
          && p / 2
        ]
        && -n
    ]
    // toggle the flag
    ^= p
  )
```
### Keeping track of previous digits
Flags for visited digits are stored at negative indices in the input array **a**, so that they don't collide with its original elements.
* If **p** is set to **-n**:
If the current digit **n** was not previously selected, `a[-n] ^= -n` will set the flag and let the `every()` loop go on with the next iteration. Otherwise, it will clear the flag and force the loop to fail immediately.
* If **p** is set to **undefined**:
`a[undefined] ^= undefined` results in **0**, which also forces the loop to fail.
### Detecting opposed digits
The following expression is used to test whether the current digit **n** and the previous digit **-p** are opposed digits, as defined in the preamble:
```
n & p & ((p * n) % 5 < 0) | ~(p -= n) == 9
```
which is equivalent to:
```
n & p & ((p * n) % 5 < 0) | (p -= n) == -10
```
*Note: In JS, the result of the modulo has the same sign as the dividend.*
It can be interpreted as:
```
(n is odd AND -p is odd AND (neither -p or n is equal to 5)) OR (n + -p = 10)
```
Therefore, this expression returns **1** if and only if **n** and **-p** are opposed digits *or* they are the same odd digit. Because a digit can't be selected twice, this latter case is correctly taken care of anyway.
If this expression returns **1**, we test **a[p / 2]** (where **p** is now equal to the negated sum of the digits) in order to know whether the 'in-between digit' was previously visited. Otherwise, we test **a[0]** which is guaranteed to be truthy.
### About the first iteration
The first iteration is a special case, in that there is no previous digit and we want it to be unconditionally successful.
We achieve that by initializing **p** to **1**, because for any **n** in **[1 .. 9]**:
* `(1 * n) % 5` can't be negative
* `~(1 - n)` can't be equal to 9
---
# Original answer, 90 bytes
*Removed from this post so that it doesn't get too verbose. You can [see it here](https://codegolf.stackexchange.com/revisions/155585/9).*
[Answer]
# x86 32-bit machine code, ~~62~~ 60 bytes
Hexdump:
```
33 c0 60 8b f2 33 db 99 80 f9 02 72 2d ad 50 0f
ab c2 72 25 3b c3 77 01 93 2b c3 d1 e8 72 14 68
92 08 0e 02 0f a3 5c 04 ff 5f 73 07 03 d8 0f a3
da 73 06 5b e2 d7 61 40 c3 58 61 c3
```
It receives the length of the list in `ecx` and a pointer to the first element in `edx`, and returns the result in `al`:
```
__declspec(naked) bool __fastcall check(int length, const int* list)
```
There are 8 lines that contain a node in the middle:
```
1 - 3
4 - 6
7 - 9
1 - 7
2 - 8
3 - 9
1 - 9
3 - 7
```
I grouped them according to the difference between the bigger and the smaller number.
```
Difference 2: 3 lines (starting at 1, 4 or 7)
    1 - 3
    4 - 6
    7 - 9
Difference 4: 1 line (starting at 3)
    3 - 7
Difference 6: 3 lines (starting at 1, 2 or 3)
    1 - 7
    2 - 8
    3 - 9
Difference 8: 1 line (starting at 1)
    1 - 9
```
Then, I converted that to a 2-D lookup table indexed by half-difference and smaller number:
```
76543210
--------
10010010 - half-difference 1
00001000 - half-difference 2
00001110 - half-difference 3
00000010 - half-difference 4
```
This makes a "magic" bitmap of 32 bits. To index it, the code pushes it into the stack. Then, it extracts one byte using one index, and from that byte, it extracts one bit using the other index. All this using one instruction:
```
bt byte ptr [esp + eax - 1], ebx; // -1 because half-difference is 1-based
```
If the bitmap indicates that there is a node in the middle, it's easy to calculate - add half the difference to the smaller number.
Assembly source:
```
    xor eax, eax;   // prepare to return false
    pushad;         // save all registers
    mov esi, edx;   // esi = pointer to input list
    xor ebx, ebx;   // ebx = previously encountered number = 0
    cdq;            // edx = bitmap of visited numbers = 0
    cmp cl, 2;      // is input list too short?
    jb bad_no_pop;  // bad!
again:
    lodsd;          // read one number
    push eax;
    bts edx, eax;   // check and update the bitmap
    jc bad;         // same number twice? - bad!
    cmp eax, ebx;   // sort two recent numbers (ebx = minimum)
    ja skip1;
    xchg eax, ebx;
skip1:
    // Check whether the line crosses a node
    sub eax, ebx;   // calculate half the difference
    shr eax, 1;
    jc skip_cross;  // odd difference? - no node in the middle
    push 0x020e0892;// push magic bitmap onto stack
    bt byte ptr [esp + eax - 1], ebx; // is there a node in the middle?
    pop edi;
    jnc skip_cross; // no - skip the check
    add ebx, eax;   // calculate the node in the middle
    bt edx, ebx;    // was it visited?
    jnc bad;        // no - bad!
skip_cross:
    pop ebx;
    loop again;
    // The loop was finished normally - return true
    popad;          // restore registers
    inc eax;        // change 0 to 1
    ret;            // return
    // Return false
bad:
    pop eax;        // discard data on stack
bad_no_pop:
    popad;          // restore registers
    ret;            // return
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~140~~ ~~131~~ ~~114~~ ~~104~~ 99 bytes
-2 bytes thanks to [Jonathan Frech](https://codegolf.stackexchange.com/users/73111/jonathan-frech)  
-5 bytes thanks to [Chas Brown](https://codegolf.stackexchange.com/users/69880/chas-brown)
```
v={0};k=input()
for l,n in zip(k,k[1:])or q:(2**n+~2**l)%21%15%9==5<v-{l+n>>1}==v>q;v|={l};n in v>q
```
[Try it online!](https://tio.run/##TU7LboMwELzzFRYSAhJXqnmkAWpu6bG99BZxoNQRCMcQ19BSSn@dLg@lucx6ZjyzW3cqr4QzZtU7o7qujy3t74eopIWoG2XZ2qmSiGOBCoG@i9oqcXkkYWKDegktZ7MR219AbhsOMYhvBJT6j@1dz7cijslAaRtfovaH9nyI5hLgI@zRPvOCM/QqGxZqCCnZTQMh9sUyNB0zs1oWQiFTyUblnalNdsZqhQ4vTwcpK7lk3iRLy3/zOT2zG3ftOKX8g3XmeCTYSTTAHaCP9ytzsIt9/DC/Ya66B/oOHHKje0tiVtwZA8Dlj7sq7rXJW7MBZGFD8gc "Python 2 – Try It Online")
## Explanation:
```
# full program, raising a NameError for invalid input
v={0}            # set of visited nodes
k=input()        # load pattern
# iterate through adjacent pairs, if there is no pair, raise a NameError
for l,n in zip(k,k[1:])or q:
  # detect moves skipping over nodes, details below
  (2**n + ~2**l) % 21 % 15 % 9 == 5 < v - {l+n >> 1} == v > q
  v |= {l}       # add the last node to the set of visited nodes
  n in v > q     # if the current node was previously visited, raise a NameError
```
[Try it online!](https://tio.run/##bVNNc9owEL37V7yB6QCJy5SvtDA1t/TYXnrLcFDsBVSE5MiyKU3pX6cr2Xwkg2e8wm8/3tPuku/d2ujhMTUZJa1W69jGslQKuTUrK7YxrJCF1CsIfBdberTWWCz5lboSSmZ85qWLquT10wFXTxsFOZglKk53lEEzQRFtkhDf7V3ilBEZcuEcWR21wcFWOIJbW1Ou1hDZL5GSdhwibRFDLtlFliALrhnQWiRdS4y8RBVrloc/Mu9u4s3TYLboMfoyizxtRo5Sh62pqECxkXnub8lftpYa@wghVYFnUmbHOd3h3Z3GPf7xqXr4gOGAzWDCZookwQRfUeEjXtW9xnyOwcGjFeZ44ewKfxN2Hc73FlnmbwIlChco4UwAbjYOUEig3zfYx6eltb5B1zVCUaOJ80IPgoomr@7g27SdKHjkVElTFmp/4r7R2CPvSLRbS0X4aUvyvXR27w@AflMKv0hniR4pwzApOML4pEMmM91xdfUMQqPeq36/HwrlVrKwjrOlW@87vhB7QpGwPUFt7Yw8a0q5uyicXV3RazmRXO3vO56lUIWnuckTnBeaxx/fGpaaZscEJNI11cMknfnZXUqcqJ45avPm/xGoyG6lFk2HlDH58WkQDxcR2we2k/hL8zWMR/Ek/hx@89ngY8Yf2DO4wsd1RkBGwU7Z1jGjBhmdK42b3CnnMsPiPw "Python 2 – Try It Online")
Only 8 pairs of nodes have a node in between them. A pair of nodes can be represented as a single integer by the formula `2^a-2^b-1`. This number can be shortened by repeated modulo:
```
a  b  2^a-2^b-1  (2^a-2^b-1)%21%15%9
1  3         -7                    5
1  7       -127                    5
1  9       -511                    5
2  8       -253                    5
3  1          5                    5
3  7       -121                    5
3  9       -505                    5
4  6        -49                    5
6  4         47                    5
7  1        125                    5
7  3        119                    5
7  9       -385                    5
8  2        251                    5
9  1        509                    5
9  3        503                    5
9  7        383                    5
```
`(2**n+~2**l)%21%15%9==5` first checks if such a pair is present, then `v-{l+n>>1}==v` tests whether the node in between, which is given by `(a+b)/2`, was not visited yet and `q` raises a NameError. By using chained comparison between these pairs, the next comparison is only executed when the previous returned `True`.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~24 22 19 18~~ 17 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-2 since we are no longer required to handle an empty list  
-1 switching from join, `j@`, to concatenate, `;` (the missed item does not *need* to be encountered in the middle for the method employed, being at the start of the trio is fine)  
-2 switching from `P¬aSH` to `oSH`(OK to have two results since we flatten, half of `1` is `0.5` which is filtered out anyway, and having multiple equal results has no affect on the method employed either)  
-1 Thanks to Mr. Xcoder (0-indexed input is allowed)  
-1 using the (newer) invariance quick, `Ƒ`, and filter-keep quick alias, `Ƈ`.
```
d3ZIỊoSH;µƝFḞƑƇQ⁼
```
A monadic link taking a list of integers in `[0,8]` and returning a truthy value (`1`) if legal and a falsey value (`0`) if not.
**[Try it online!](https://tio.run/##ATQAy/9qZWxsef//ZDNaSeG7im9TSDvCtcadRuG4nsaRxodR4oG8////WzMsNCw3LDEsMiw4LDNd "Jelly – Try It Online")** or see a [test-suite](https://tio.run/##y0rNyan8/z/FOMrz4e6u/GAP60Nbj811e7hj3rGJx9oDHzXu@X@4/VHTmqN7HI5OerhzBpDpDcSR//9HRxvE6kQb6BgBSSMdAzBpBBHRMQPTJjrGOhA1FjpmQFETMNtQxxQobg4Ug6kzBKtEEQGTpkDSBChuCFUFNAFushlU3BhsnhHUHoi4MVyHKYrJsQA "Jelly – Try It Online").
### How?
Looks at each adjacent pair of 0-indexed nodes in the input list. If the integer division by three of the two differs by 2 they are on the top and bottom rows, if the modulo by three of the two differs by 2 they are in the left and right columns. The sum of such pairs divided by two is either the 0-indexed mid-node of a three-node-line or a non-integer value -- so these values are first inserted in-front of the 0-indexed pair and then any bogus nodes (like `0.5` or `3.5`) are removed, the resulting list of lists is flattened and then de-duplicated (to yield order-preserved, unique entries) and finally compared to the input - for a legal swipe all of this will end up being a no-op while illegal ones will add missing mid-nodes and/or remove duplicate nodes (note that no special casing is required for an input list of length 1 since it has no adjacent pairs):
```
d3ZIỊoSH;µƝFḞƑƇQ⁼ - left input is a list of integers   e.g. [3,4,7,1,2,8,3]
         µƝ       - perform the chain to the left for adjacent pairs:
                  - e.g. for [a,b] in:   [3,4]         [4,7]         [7,1]         [1,2]         [2,8]         [8,3]
d3                -   divmod by 3        [[1,0],[1,1]] [[1,1],[2,1]] [[2,1],[0,1]] [[0,1],[0,2]] [[0,2],[2,2]] [[2,2],[1,0]]
  Z               -   transpose          [[1,1],[0,1]] [[1,2],[1,1]] [[2,0],[1,1]] [[0,0],[1,2]] [[0,2],[2,2]] [[2,1],[2,0]]
   I              -   differences        [0,1]         [1,0]         [-2,0]        [0,1]         [2,0]         [-1,-2]
    Ị             -   abs(v)<=1          [1,1]         [1,1]         [0,1]         [1,1]         [0,1]         [1,0]
      S           -   sum (of [a,b])      7            11            8              3            10            11
     o            -   OR (vectorises)    [1,1]         [1,1]         [8,1]         [1,1]         [10,1]        [1,11]
       H          -   halve (vectorises) [0.5,0.5]     [0.5,0.5]     [4,0.5]       [0.5,0.5]     [5,0.5]       [0.5,5.5]
        ;         -   concatenate        [0.5,0.5,3,4] [0.5,0.5,4,7] [4,0.5,7,1]   [0.5,0.5,1,2] [5,0.5,2,8]   [0.5,5.5,8,3]
           F      - flatten              [0.5,0.5,3,4,  0.5,0.5,4,7,  4,0.5,7,1,    0.5,0.5,1,2,  5,0.5,2,8,    0.5,5.5,8,3]
              Ƈ   - keep those for which:
             Ƒ    -   is invariant under?:
            Ḟ     -     floor            [        3,4,          4,7,  4,    7,1,            1,2,  5,    2,8,           ,8,3]
               Q  - deduplicate          [3,4,7,1,2,5,8]
                ⁼ - equal to the input?  e.g. 0 (here because 5 was introduced AND because 3 was removed from the right)
```
---
Previous method
[Jelly](https://github.com/DennisMitchell/jelly), ~~36~~ 35 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
9s3;Z$;“Æ7a‘DZ¤;U$;©0m€2iị®oµƝFQ⁼ȧȦ
```
[Try it online!](https://tio.run/##AUwAs/9qZWxsef//OXMzO1okO@KAnMOGN2HigJhEWsKkO1UkO8KpMG3igqwyaeG7i8Kub8K1xp1GUeKBvMinyKb///9bMSw1LDcsOCw0LDJd "Jelly – Try It Online") or see a [test-suite](https://tio.run/##y0rNyan8/9@y2Ng6SsX6UcOcw23miY8aZrhEHVpiHapifWilQe6jpjVGmQ93dx9al39o67G5boGPGvecWH5i2f/D7UCpo3scjk56uHMGkOkNxJH//0dHx@pEG4KwjjGQNNYxBJPGEBEdczBtqmOiA1FjqWMOFDUFs410zIDiFkAxmDojsEoUETBpBiRNgeJGUFVAE@Amm0PFTcDmGUPtgYibwHWYoZgcCwA "Jelly – Try It Online").
### How?
Similar to the above but constructs all three-node-line possibilities and performs look-up (rather than checking as it goes using divmod to test and halving the sum for the mid-node).
Firstly the construction of the list of three-node-lines:
```
9s3;Z$;“Æ7a‘DZ¤;U$;©0
9s3                   - nine (implicit range) split into threes = [[1,2,3],[4,5,6],[7,8,9]]
     $                - last two links as a monad:
    Z                 -   transpose = [[1,4,7],[2,5,8],[6,7,9]]
   ;                  -   concatenate = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9]]
              ¤       - nilad followed by link(s) as a nilad:
       “Æ7a‘          -   code-page index list = [13,55,97]
            D         -   decimal (vectorises) = [[1,3],[5,5],[9,7]]
             Z        -   transpose = [[1,5,9],[3,5,7]]
      ;               - concatenate = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]]
                 $    - last two links as a monad:
                U     -   upend = [[3,2,1],[6,5,4],[9,8,7],[7,4,1],[8,5,2],[9,6,3],[9,5,1],[7,5,3]]
               ;      -   concatenate = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7],[3,2,1],[6,5,4],[9,8,7],[7,4,1],[8,5,2],[9,6,3],[9,5,1],[7,5,3]]
                    0 - literal zero (to cater for non-matches in the main link since ị, index into, is 1-based and modular the 0th index is the rightmost)
                  ;   - concatenate = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7],[3,2,1],[6,5,4],[9,8,7],[7,4,1],[8,5,2],[9,6,3],[9,5,1],[7,5,3],0]
                   ©  - copy the result to the register
```
Now the decision making:
```
...m€2iị®oµƝFQ⁼ȧȦ - left input is a list of integers               e.g. [4,5,8,2,3,9,4]
          µƝ      - perform the chain to the left for adjacent pairs:
                  - i.e. for [a,b] in [[4,5],[5,8],[8,2],[2,3],[3,9],[9,4]]
...               -   perform the code described above = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7],[3,2,1],[6,5,4],[9,8,7],[7,4,1],[8,5,2],[9,6,3],[9,5,1],[7,5,3],0]
   m€2            -   modulo-2 slice €ach = [[1,3],[4,6],[3,9],[1,7],[2,8],[6,9],[1,9],[3,7],[3,1],[6,4],[9,7],[7,1],[8,2],[9,3],[9,1],[7,3],[0]]
      i           -   index of [a,b] in that (or 0 if not there)    e.g. [0,0,13,0,6,0]
        ®         -   recall from register = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7],[3,2,1],[6,5,4],[9,8,7],[7,4,1],[8,5,2],[9,6,3],[9,5,1],[7,5,3],0]
       ị          -   index into (1-based & modular)     e.g. [0,0,[8,5,2],0,[3,6,9],0]
         o        -   OR [a,b]           e.g. [[4,5],[5,8],[8,5,2],[2,3],[3,6,9],[9,4]]
            F     - flatten                          e.g. [4,5,5,8,8,5,2,2,3,3,6,9,9,4]
             Q    - deduplicate                                    e.g. [4,5,8,2,3,6,9]
              ⁼   - equal to the input?                            e.g. 0 (here because 6 was introduced AND because 4 was removed from the right)
                Ȧ - any and all? (0 if input is empty [or contains a falsey value when flattened - no such input], 1 otherwise)
               ȧ  - AND (to force an empty input to evaluate as 1 AND 0 = 0)
```
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 28 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
æ¡_t¿♂≥7▼├öä▒╨½╧£x╪╨┌i╒ë╖¢g•
```
[Run it](http://stax.tomtheisen.com/#c=%C3%A6%C2%A1_t%C2%BF%E2%99%82%E2%89%A57%E2%96%BC%E2%94%9C%C3%B6%C3%A4%E2%96%92%E2%95%A8%C2%BD%E2%95%A7%C2%A3x%E2%95%AA%E2%95%A8%E2%94%8Ci%E2%95%92%C3%AB%E2%95%96%C2%A2g%E2%80%A2&i=%5B1%5D%0A%0A%5B1%2C3%5D%0A%0A%5B3%2C1%5D%0A%0A%5B3%2C3%5D%0A%0A%5B1%2C3%2C7%5D%0A%0A%5B1%2C5%2C4%2C1%5D%0A%0A%5B1%2C9%2C7%2C3%2C5%5D%0A%0A%5B1%2C2%5D%0A%0A%5B1%2C6%5D%0A%0A%5B5%2C8%2C2%5D%0A%0A%5B1%2C2%2C3%2C5%2C7%5D%0A%0A%5B1%2C5%2C7%2C8%2C2%5D%0A%0A%5B4%2C2%2C6%2C3%2C1%5D%0A%0A%5B1%2C5%2C7%2C8%2C4%2C2%5D&a=1&m=1)
It produces 0 for false, and positive integers for true. The corresponding ascii representation of the same program is this.
```
cu=x%v*x2BF1379E-%_|+YA=!*yhxi(#+*
```
The general idea is calculate several necessary conditions for legal swipe patterns and multiply them all together.
```
cu=                                 First: no duplicates
   x%v*                             Second: length of input minus 1
       x2B                          Get all adjacent pairs  
          F                         For each pair, execute the rest
           1379E-%                  a) Any digits that are not 1, 3, 7, 9?
                  _|+Y              Get sum of pair, and store in Y register
                      A=!           b) Sum is not equal to 10?
                         *          c) multiply; logical and: a, b
                          yh        half of y; this will be equal to the
                                        number directly between the current
                                        pair if there is one
                            xi(#    d) has the middle number been observed yet?
                                +   e) plus; logical or: c, d
                                 *  multiply by the accumulated value so far
```
[Answer]
# JavaScript, 112 bytes
```
x=>/^(?!.*(.).*\1|[^5]*(19|28|37|46|91|82|73|64)|[^2]*(13|31)|[^8]*(79|97)|[^4]*(17|71)|[^6]*(39|93))../.test(x)
```
Maybe some regex based language should be more shorter. But I don't know.
```
f=
x=>/^(?!.*(.).*\1|[^5]*(19|28|37|46|91|82|73|64)|[^2]*(13|31)|[^8]*(79|97)|[^4]*(17|71)|[^6]*(39|93))../.test(x)
```
```
<input id=i oninput=o.value=(f(i.value)?'':'in')+'valid'> is <output id=o>
```
Thanks to Neil, change `)(?!` to `|` save 3 bytes.
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~25~~ 20 bytes
```
S=öufΛ¦1ΣẊ§Jzo½+em‰3
```
Takes a list of integers with 0-based indexing.
Returns 0 or 1.
[Try it online!](https://tio.run/##yygtzv6vkKtR/KipsUjz0Lb/wbaHt5WmnZt9aJnhucUPd3UdWu5VlX9or3Zq7qOGDcb///@PNojlijbQMQSTRmDSFEga6RiASYiIkY4ZkDbRMQerM9Ex0LEAi5voGOtA9QPVmIBVgUTNoCqB6oBsoAyQbQxUY6pjBFUPUWMMVmUIVWUONNcUKGYCFTOGi5kBxQA "Husk – Try It Online")
## Explanation
I stole some ideas from Jonathan Allan's [Jelly answer](https://codegolf.stackexchange.com/a/155617/32014).
The idea is the same: insert a new "average node" between each adjacent pair, filter out those that are not actual nodes, remove duplicates and compare to the original list.
If the original list contains duplicates, the result is falsy.
If the list skips an unvisited node, then it is present in the processed list between the corresponding pair, and the result is falsy.
If the input is a singleton, the processed list is empty, and the result is falsy.
Otherwise, it is truthy.
```
S=öufΛ¦1ΣẊ§Jzo½+em‰3  Implicit input, say [0,4,6,7,1]
                 m‰3  Divmod each by 3: L = [[0,0],[1,1],[2,0],[2,1],[0,1]]
         Ẋ§Jzo½+e     This part inserts the middle node between adjacent nodes.
         Ẋ            Do this for each adjacent pair, e.g. [1,1],[2,0]:
          §           Apply two functions and combine results with third.
            zo½+      First function:
            z         Zip with
               +      addition,
             o½       then halve: N = [3/2,1/2]
                e     Second function: pair: P = [[1,1],[2,0]]
           J          Combining function: join P with N: [[1,1],[3/2,1/2],[2,0]]
                      Result is a list of such triples.
        Σ             Concatenate: [[0,0],[1/2,1/2],[1,1],[1,1],[3/2,1/2],...,[0,1]]
    f                 Keep only those pairs
     Λ                both of whose elements
      ¦1              are divisible by 1, i.e. are integers: [[0,0],[1,1],[1,1],,...,[0,1]]
   u                  Remove duplicates: [[0,0],[1,1],[2,0],[2,1],[0,1]]
S=ö                   Is the result equal to L? Implicitly print 1 or 0.
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 98 bytes
Influenced by tsh's [answer](https://codegolf.stackexchange.com/a/155582/34718). I tried to "rephrase" it to be the opposite, matching invalid swipes, then Anti-grepping.
```
A`(.).*\1|^([^5]*(19|28|37|46|91|82|73|64)|[^2]*(13|31)|[^8]*(79|97)|[^4]*(17|71)|[^6]*(39|93)|.$)
```
[**Try it online**](https://tio.run/##HYoxDgIxDAR7vwOk5IpIjpM4KXnHQXQUFDQUiHL/Huzrdmb2@/q9P891DQet2xFSTNudMcM@62MLPJA7RFEaBqNnqKCViH1mzwJhh26gA0MdiheFnqUZiBWJSJe4FhNnYiFuJExiQ5RqN1eLN6lqU10MlUolN/u5KfkP)
[Answer]
## C++, ~~267~~ 256 bytes
```
#define R)return 0
#define H(a,q)if(d==q&&n==a&&!m[a]R;
int v(int s[],int l){if(l<2 R;int m[10]{},i=1,p=s[0],d,n;for(;i<l;++i){m[p]=1;if(m[s[i]]R;d=(d=p-s[i])<0?-d:d;if(d%2<1){n=(p+s[i])/2;H(5,4)H(5,8)H(2,2)H(5,2)H(8,2)H(4,6)H(5,6)H(6,6)}p=s[i];}return 1;}
```
To check if the pattern does not skip over a unvisited node, it does several things :
1. Calculate `d` where `d` is the numerical difference between the current node and the last node.
2. If `d` is odd, then there's no need to check, it can't skip over a node.
3. If `d` is equal to `4` or `8`, then the jump is between nodes `1-9` or `3-7`, so check node `5`
4. If `d` is 2, and the middle node ( `(last_node + current_node)/2` ) is either 2,5 or 8, then check the middle node
5. If `d` is 6, same check as before but with `4`,`5` or `6`
The parameters are an `int[]` and it's element count.
It returns an `int` which can be interpreted as a `bool` type
[Answer]
# Perl, 135 bytes (134 + `-n`)
```
@a{split//}=1;(@{[/./g]}==keys%a&&/../)||die();for$c(qw/132 465 798 174 285 396 195 375/){$c=~/(.)(.)(.)/;/^[^$3]*($1$2|$2$1)/&&die()}
```
Slightly ungolfed version
```
@a{split//} = 1;
(@{[/./g]} == keys %a && /../) || die();
for $c (qw/132 465 798 174 285 396 195 375/) {
  $c=~/(.)(.)(.)/;
  /^[^$3]*($1$2|$2$1)/&&die()
}
```
Outputs via exit code. `0` is truthy, any other value is falsy. As per [meta consensus](https://codegolf.meta.stackexchange.com/questions/4780/should-submissions-be-allowed-to-exit-with-an-error/4784), STDERR output in the failure case is ignored.
There's probably a quicker way to check the "can't jump over" rule than simply listing all the possibilities.
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~42~~ ~~41~~ 39 bytes
```
9:IeXKi"Ky@=&fJ*+XK+y&fJ*+Em~zw0@(]z8<v
```
This produces
* a non-empty column vector containing only *non-zero numbers* as truthy output; or
* a non-empty column vector containing *at least a zero* as falsy.
[Here](https://codegolf.stackexchange.com/a/95057/36398) you can read why these outputs are respectively truthy and falsy. [**Try it online!**](https://tio.run/##y00syfn/39LKMzXCO1PJu9LBVi3NS0s7wlu7Esxwza2rKjdw0IitsrAp@/8/2lDBSMFYwVTBPBYA)
Or [**verify all test cases**](https://tio.run/##dZA/T8MwEMX3foqnShBEpUBJ/yIQHcpQsjB0qFRFwpALtnDsyHYoqQRfPThpYEDFw7unu9/5zs6Zk/UTjpwTLHUYhjsuJEFqXcBpGGIphCpKh1I5IUEfnJXWUVrPr1e0iUU/rha3p9nD@WATD6rW3Odf@93l4izZz27e67vAmdLxKvgMMiZtFSTtsFWGC5C01ASV4tkw9cLhOHMoSsvJek9gRWF0YQRzBOuMUK@95T/bC1tIVv1Q6@PUo78afb8R9UOsubDI2Vs3K/3zfqEyoYSjECsHMkYbix0n1cCG4HuVRq4b2/xQvR0mve0QV61GrU68Rhi2eshEmPo4xqzjxhih6/O1cVttstNfYu69r3g/8swEUccfGJ9LvgE), with footer code that includes the standard [test](https://codegolf.meta.stackexchange.com/questions/2190/interpretation-of-truthy-falsey/2194#2194) for truthiness/falsiness.
[Answer]
# [Stax](https://github.com/tomtheisen/stax), ~~73~~ ~~72~~ ~~66~~ 65 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)CP437
```
ÉWyƒ▬ºJOTƒw-H┌↓&ⁿç↨¼<ü6π║¢S○j⌂zXΣE7≈╩╕╤ö±÷C6▒☼■iP-↑⌐¥]╩q|+zΦ4Φ·¥Ω
```
79 bytes when unpacked,
```
d4{cAs-5F132396978714EEL3/{xs:IBc0<A*++cEd:-1=sccHs|M=s{U>m|A**mEx%2<xu%x%=!L|+
```
[Run and debug online!](http://stax.tomtheisen.com/#c=%C3%89Wy%C6%92%E2%96%AC%C2%BAJOT%C6%92w-H%E2%94%8C%E2%86%93%26%E2%81%BF%C3%A7%E2%86%A8%C2%BC%3C%C3%BC6%CF%80%E2%95%91%C2%A2S%E2%97%8Bj%E2%8C%82zX%CE%A3E7%E2%89%88%E2%95%A9%E2%95%95%E2%95%A4%C3%B6%C2%B1%C3%B7C6%E2%96%92%E2%98%BC%E2%96%A0iP-%E2%86%91%E2%8C%90%C2%A5%5D%E2%95%A9q%7C%2Bz%CE%A64%CE%A6%C2%B7%C2%A5%CE%A9&i=%5B4%2C6%2C3%2C1%5D&a=1)
or run the [batch test](http://stax.tomtheisen.com/#c=meXd4%7BcAs-5F132396978714EEL3%2F%7Bxs%3AIBc0%3CA*%2B%2BcEd%3A-1%3DsccHs%7CM%3Ds%7BU%3Em%7CA**mEx%252%3Cxu%25x%25%3D%21L%7C%2B&i=%5B1%5D%0A%5B1%2C2%5D%0A%5B1%2C3%5D%0A%5B1%2C6%5D%0A%5B3%2C1%5D%0A%5B3%2C3%5D%0A%5B5%2C8%2C2%5D%0A%5B5%2C1%2C9%5D%0A%5B1%2C5%2C4%2C1%5D%0A%5B1%2C2%2C3%2C5%2C7%5D%0A%5B1%2C5%2C7%2C8%2C2%5D%0A%5B1%2C9%2C7%2C3%2C5%5D%0A%5B4%2C2%2C6%2C3%2C1%5D%0A%5B1%2C5%2C7%2C8%2C4%2C2%5D%0A%5B2%2C9%2C7%2C3%2C8%2C1%2C6%2C4%2C5%5D%0A%5B2%2C9%2C4%2C3%2C8%2C1%2C6%2C7%2C5%5D&a=1), where `meX` is a header so that Stax can process multiline input.
Implementation without using hash.Outputs strictly positive number (actually the number of failed tests) for **falsy** cases and `0` for **truthy** ones.
## Explanation
`d` clears the input stack. The input is in variable `x` anyway.
`4{cAs-5F` generates first part of the middle-node list.
`132396978714EE` hardcodes the second part of the middle-node list.
`L3/` Collects all elements in main stack and divide into parts each containing 3 elements, the result is array `a`, which is just the array of all invalid 3-node groups.
`{xs:IBc0<A*++cEd:-1=sccHs|M=s{U>m|A**mE` For each invalid node list, perform the following checks. The result of the check results are `and`ed using the `**`. Since there are 8 invalid node lists, the result of this code will be an array of 8 elements. The final `E` dispatches the array to its individual elements on the main stack.
`xs:I` get the index of the node list elements in the input array.
`Bc0<A*++` If the index of "middle node" (e.g. `5` in the node set `1,5,9`) is `-1` (which means it doesn't exist in the input array), change the index to `9`.
`cEd:-1=` test whether the two "terminal nodes" (e.g. `1,5` in the node set `1,5,9`) are adjacent in the input array.
`sccHs|M=` test whether the transformed index of the "middle node" is larger than those of the two "terminal nodes", which includes two cases: the "middle node" is missing, or the "middle node" comes after the two "terminal nodes"
`s{U>m|A` tests whether both indexes of the "end nodes" are nonnegative. (i.e. they both appear in the input).
Two additional tests are performed,
`x%2<` tests whether the input array is a singleton.
`xu%x%=!` tests whether are nodes that have been visited twice.
There are 10 test result on the main stack (one for each of the invalid node list, plus two additional tests).
`L|+` collects the 10 elements and adds them. `|a` could have also been used which simply checks whether there are any truthy elements on the array.
Implicit output.
[Answer]
## Java, ~~375~~ 355 bytes
-20 bytes thanks to Zacharý
```
int v(int s[]){int[]m=new int[10];int i=1,p=s[0],d,n,l=s.length;if(l<2)return 0;for(;i<l;++i){m[p]=1;if(m[s[i]]!=0)return 0;d=(d=p-s[i])<0?-d:d;if(d%2==0){n=(p+s[i])/2;if((d==4||d==8)&&n==5&&m[5]==0)return 0;if(d==2&&(n==2&&m[2]==0||n==5&&m[5]==0||n==8&&m[8]==0))return 0;if(d==6&&(n==4&&m[4]==0||n==5&&m[5]==0||n==6&&m[6]==0))return 0;}p=s[i];}return 1;}
```
This is a port of [this answer](https://codegolf.stackexchange.com/a/156070/72535) and it works on the same principles
[Answer]
# [Python 2](https://docs.python.org/2/), 97 bytes
Based on [ovs' answer](https://codegolf.stackexchange.com/a/155593/89125) but 2 bytes shorter and less cryptic. Just converts indexes to 2d coordinates and tests parity. Assumes 0-8 indexes.
```
v={9}
s=input()
for n,l in zip(s[1:]or q,s):n/3+l/3&1|n%3+l%3&1or n+l>>1in v or q;v|={l};n in v>q
```
[Try it online!](https://tio.run/##bZBPc4IwEMXvfIodO1YdMyqgrcXBmz22l94cDymEIVMMGALWqp@dbkL8M53msFnevn0/oDioNBdeE@UxCzudTlOHx5ezU4ZcFJXqD5wklyBIBlzADy/65doNNijtSDkIxNgfZmP/0T2JLnZd7LR7mC2XLvpr0MZFfQqP2XkhdES93DVIcfYpzxh8yIoFDoCSB30BsG8WgX4VaM@DUSrFQKXMDAjwBLiCmMeip0BSXrIYqICVlEgbjUYmqJBcKOgpWan00NNBODEh5rtgT0toh46mRqxQ8Ea3zKQEaEfKBXmF3Bx/OQnNSo35l2OGN8zq/dVSWsweAYxGKRL0HhMx5MldxAX1ia4vuB2LYnLLBbV/KMvzollPiLtxsM6wTsmzfXKJR6bkyfR4W91HfYaTyZ3utxtG8UydY209nlW8a5Jvd@e4i4TNLw "Python 2 – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 35 bytes
```
eUä@[(Xu3 aYu3)¥1ªX+Y ÷2XY]Ãc f9o)â
```
[Try it online!](https://ethproductions.github.io/japt/?v=2.0a0&code=VWVV5EBbKFh1MyBhWXUzKaUxqlgrWSD3MlhZXcNjIGY5byni&input=LW1SIFsKWzBdLCAvLyBmYWxzZQpbMCwxXSwgLy8gdHJ1ZQpbMCwyXSwgLy8gZmFsc2UKWzAsNV0sIC8vIHRydWUKWzIsMF0sIC8vIGZhbHNlClsyLDJdLCAvLyBmYWxzZQpbMCwyLDZdLCAvLyBmYWxzZQpbNCw3LDFdLCAvLyB0cnVlCls0LDAsOF0sIC8vIHRydWUKWzAsNCwzLDBdLCAvLyBmYWxzZQpbMCwxLDIsNCw2XSwgLy8gdHJ1ZQpbMCw0LDYsNywxXSwgLy8gdHJ1ZQpbMCw4LDYsMiw0XSwgLy8gZmFsc2UKWzMsMSw1LDIsMF0sIC8vIHRydWUKWzAsNCw2LDcsMywxXSwgLy8gdHJ1ZQpbMCw1LDYsMSw4LDMsMiw3LDRdLCAvLyB0cnVlClsxLDgsNiwyLDcsMCw1LDMsNF0sIC8vIGZhbHNlClsxLDgsMywyLDcsMCw1LDYsNF0gLy8gdHJ1ZQpd)
### Slightly ungolfed & How it works
```
eUä@[(Xu3 aYu3)¥1ªX+Y ÷2XY]Ãc f9o)â
Implicit beginning U(input) and some arbitrary sequence conversions
UeUä@[(Xu3 aYu3)==1||X+Y ÷2XY]} c f9o)â
  Uä             Convert the input array into length-2 subsections and map...
    @[ ... ]}      function of X,Y which returns an array of...
      Xu3 aYu3==1||X+Y ÷2          (abs(X%3 - Y%3)==1||X+Y)/2,
                         XY        X, Y
  c              Flatten the result of mapping
    f9o          Intersect with range(9)
        â        Take unique elements, preserving order
Ue             Is the result the same as original array?
```
Ported the idea from [this Jelly solution](https://codegolf.stackexchange.com/a/155617/78410), with some difference in determining potential jumps:
* The Jelly answer uses divmod to see if a pair has difference of 2 when applied `/3` or `%3`.
* This answer uses only `%3` and checks if the difference is 0 or 2. If the difference is 0, the two cells are vertically aligned, and non-jumps still share the property of `(X+Y)%2 != 0`.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 26 bytes
```
2lƛ∑n3vḋ∩vƒ-vṅv∨½p;f~¨=⌊U⁼
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCIybMab4oiRbjN24biL4oipdsaSLXbhuYV24oiowr1wO2Z+wqg94oyKVeKBvCIsIiIsIlsyLCA5LCA0LCAzLCA4LCAxLCA2LCA3LCA1XSJd)
Port of Jelly.
[Answer]
# [Pyth](https://pyth.readthedocs.io), 33 bytes
```
q{@U9.nm+mc|g1aZksd2-MC.DR3d_dC,t
```
**[Test suite.](http://pyth.herokuapp.com/?code=q%7B%40U9.nm%2Bmc%7Cg1aZksd2-MC.DR3d_dC%2Ct&test_suite=1&test_suite_input=%5B0%2C+1%5D%0A%5B0%2C+5%5D%0A%5B4%2C+7%2C+1%5D%0A%5B0%2C+1%2C+2%2C+4%2C+6%5D%0A%5B0%2C+4%2C+6%2C+7%2C+1%5D%0A%5B3%2C+1%2C+5%2C+2%2C+0%5D%0A%5B0%2C+4%2C+6%2C+7%2C+3%2C+1%5D%0A%5B0%5D%0A%5B0%2C+2%5D%0A%5B0%2C+8%5D%0A%5B2%2C+0%5D%0A%5B2%2C+2%5D%0A%5B0%2C+2%2C+6%5D%0A%5B0%2C+4%2C+3%2C+0%5D%0A%5B0%2C+8%2C+6%2C+2%2C+4%5D&debug=0)**
Uses 0-based indexing.
## Explanation
```
q{@U9.nm+mc|g1aZksd2-MC.DR3d_dC,t –> Full program. Input: a list L from STDIN.
                               ,t –> Pair L with L without the first element.
                              C   –> Transpose.
       m                          –> Map over the list of pairs (2-element lists):
        +mc|g1aZksd2-MC.DR3d      –> The function to be mapped (variable: d):
                         R d          –> For each element of d ...
                       .D 3           –> ... Take its divmod by 3.
                      C               –> Tranpose.
                    -M                –> Reduce each by subtraction.
         m                            –> For each difference (variable: k):
            g1aZl                     –> Is |k| ≤ 1?
           |     sd                   –> If that's falsy, replace it by the sum of d.
          c        2                  –> Divide by 2.
        +                   _d    –> Append the reverse of d to the result of mapping.
     .n                           –> Flatten.
  @U9                             –> Take the intersection with (ℤ ∩ [0; 9)).
 {                                –> Deduplicate.
q                                 –> And check whether the result equals L.
```
Alternative approach for **34 bytes**:
```
q{sI#I#+Fm+,hdcR2+MCd]edCtBK.DR3QK
```
[Answer]
# Haskell, 97 bytes
```
(%)=elem
f(h:t)=t>[]&&and[x%a<(gcd(x*v)10>1&&x+v/=10||div(x+v)2%a)|x:a@(v:_)<-scanl(flip(:))[h]t]
```
[Try it online!](https://tio.run/##VY5db4IwGIXv@yvekWnaDTbLhyARs2TZ1WZ2sUtHlkaKktVCSkEu/O@uaOKgd@ec57w9e1b/ciHOZzwhCRf8gHK8jzVJ9GqTTqdMZptuwpZ4t81w99ASOlvR6bR7bJ8TOjudsqLFRhB3wsipi9kLbuMfsnTqLZMC56KocEzIZp/q9JyXag0J9CYcWLVGB1ZIY2QlAtjB0oEd16@l1Fzq2lgXHotC8hp2BO7hW4CzuuIAgmvYFDZTqjzaZWruHEuV1SAuadXoL60@pGk18hoYGK40lDZYjuNYNhQ55IDNGqw4y56qRnFSEEgSwGWSWFo13CKg91yC9fluARc1B@vNnFF3Vnqm/aCc9Wb/EHV7o29dlDeMEZ3/h8gbVZE3RE0xHKVudJMoiAZ/oIAuBooGPh3dcb0gHCzqiTAab1yEXjDs@O78uu1GmIo//JPOQ3fhe1EwpFxzJ6JzPxgP7znD39A/ "Haskell – Try It Online")
Make sure `t>[]` (so length ≥ 2), and then: for each reversed-prefix matching `x:a@(v:_)`, check whether visiting `x` when coming from `v` (and having visited all of `a` so far) is valid.
Going from `v` to `x` is legal under these conditions:
* `x%a<` — we have not yet visited `x`, and…
* `gcd(x*v)10>1&&x+v/=10` — `v` and `x` are *not* opposites, or
	+ `div(x+v)2%a` — if they are, at least we've visited the number between them.
Flipped back around, our "opposites check" is `gcd(x*v)10==1||x+v==10`. The `gcd` trick works because `x*v` can only be coprime to 10 if both of `x` or `v` are among `[1,3,7,9]` (opposing corners). Then, `x+v==10` takes care of the even digits.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 25 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ü‚εODÈ*y3‰øÆÄ2@·÷0Ky«}˜ÙQ
```
Port of [*@JonathanAllan*'s Jelly answer](https://codegolf.stackexchange.com/a/155617/52210), so make sure to upvote him!!
Input as a 0-based list of digits.
[Try it online](https://tio.run/##AUEAvv9vc2FiaWX//8O84oCazrVPRMOIKnkz4oCww7jDhsOEMkDCt8O3MEt5wqt9y5zDmVH//1szLDQsNywxLDIsOCwzXQ) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfaXL/8N7HjXMOrfV3@Vwh1al8aOGDYd3HG473GLkcGj74e0G3pWHVteennN4ZuB/nf/R0QY6hrE6CkDKFESZ6JhD@CY6BjoWEAlDHSMdEx0zCAfIgCkxBsqYAuUMkGWM4cYBuYY6FkABI6CwCUgQwYVIgwWhuo1AFNQsIwgPKIiw1RhmjQVQoxFEq7EO2LlALtBcmAVmcAuA0rGxAA).
**Explanation:**
```
ü‚             # Create overlapping pairs of the (implicit) input-list:
               #  i.e. [3,4,7,1,2,8,3] → [[3,4],[4,7],[7,1],[1,2],[2,8],[8,3]]
  ε            # Map each pair `y` to:
   O           #  Take the sum of the pair
               #   → [7,11,8,3,10,11]
    DÈ         #  Duplicate the sum, and check whether it's even (1 if truhy; 0 if falsey)
               #  → [0,0,1,0,1,0]
      *        #  And multiply it by the sum
               #  → [0,0,8,0,10,0]
   y           #  Push the current pair again
    3‰         #  Take the divmod-3 on both values
               #   → [[[1,0],[1,1]],[[1,1],[2,1]],[[2,1],[0,1]],[[0,1],[0,2]],[[0,2],[2,2]],[[2,2],[1,0]]]
      ø        #  Zip/transpose; swapping rows/columns
               #   → [[[1,1],[0,1]],[[1,2],[1,1]],[[2,0],[1,1]],[[0,0],[1,2]],[[0,2],[2,2]],[[2,1],[2,0]]]
       Æ       #  Reduce each by subtracting
               #   → [[0,-1],[-1,0],[2,0],[0,-1],[-2,0],[1,2]]
        Ä      #  Take the absolute value of each
               #   → [[0,1],[1,0],[2,0],[0,1],[2,0],[1,2]]
         2@    #  Check for each that it's >=2 (1 if truthy; 0 if falsey)
               #   → [[0,0],[0,0],[1,0],[0,0],[1,0],[0,1]]
           ·   #  Double each
               #   → [[0,0],[0,0],[2,0],[0,0],[2,0],[0,2]]
            ÷  #  (Integer-)divide the earlier sum by this,
               #  where dividing by 0 results in 0 in this 05AB1E version
               #   → [[0,0],[0,0],[4,0],[0,0],[5,0],[0,0]]
 0K            #  Remove all 0s
               #   → [[],[],[4],[],[5],[]]
   y«          #  Merge the pair to it
               #   → [[3,4],[4,7],[4,7,1],[1,2],[5,2,8],[8,3]]
}˜             # After the map: flatten the list
               #  → [3,4,4,7,4,7,1,1,2,5,2,8,8,3]
  Ù            # Uniquify it
               #  → [3,4,7,1,2,5,8]
   Q           # And check whether it's equal to the (implicit) input-list
               #  → 0 (falsey)
               # (after which this result is output implicitly)
```
]