[Question]
  [
# Bowling
Bowling is a game where, essentially, each player gets 10 turns to:
Take 2 attempts at knocking down 10 pins arranged in a triangle.
* between turns the pins are reset
* from the 1st to the 2nd attempt the pins are left as-is
The arrangement of the pins resembles the following scheme, with the pins numbered `0-9`:
```
6 7 8 9
 3 4 5
  1 2
   0
```
(Some rules and [scoring](https://en.m.wikipedia.org/wiki/Ten-pin_bowling#Scoring) mechanics omitted.)
# Split spare
In bowling, a [spare](https://en.m.wikipedia.org/wiki/Spare_(bowling)) is when the player manages to knock down the pins that were left standing after a first attempt. A spare is said to be a [split spare1](https://en.m.wikipedia.org/wiki/Split_(bowling)) if the pins that were left standing are not adjacent.
E.g. if the pins are laid out as such:
```
. . 8 9
 . . .
  . 2
   .
```
Then a player who manages to knock down all these 3 pins would score a split spare, given that the pin `2` is not adjacent to the `8, 9` group.
(1 for the purposes of this challenge, a split spare is defined taking into account *only* the adjacency of the pins left standing, even though Wikipedia's link states that for a split spare to take place, the pin 0 must have been knocked down already)
# Your task
Given the numbers of the pins left standing, output a Truthy value if such an arrangement would give a split spare and Falsy otherwise.
# Input
The list of all pins left standing (at least 2), in any reasonable format. Pin numbering may be 0- or 1-indexed provided it follows the numbering direction shown above. Sensible input formats include:
* a list of integers, like `[2, 8, 9]`
* a string of integers, like `"289"`
* separate arguments to a function
* an integer whose bits correspond to the pints left standing and whose least significant bit corresponds to pin `0`, e.g. `0b1100000100` for pins 2, 8 and 9.
You may assume input is sorted, if that helps you in any way.
# Output
A single consistent value for Falsy test cases and anything else for Truthy test cases.
# Test cases
## Truthy
```
[0, 9]
[2, 8, 9]
[1, 5, 8]
[3, 5]
[3, 8]
[3, 9]
[6, 8]
[6, 9]
[3, 5, 8, 9]
[5, 6]
[0, 1, 5, 6, 7, 9]
[1, 2, 8, 9]
```
## Falsy
```
[1, 2]
[7, 8, 9]
[1, 2, 5]
[2, 4]
[0, 1, 3, 6]
[2, 5, 9]
[6, 7]
[4, 7]
[4, 8]
[1, 4, 5, 7]
```
# Bonus imaginary internet points
Bonus imaginary internet points if your algorithm works for any triangle number of pins, instead of just 10.
So far, only [Grimmy's 05AB1E answer](https://codegolf.stackexchange.com/questions/199275/10-pin-bowling-split-spare/199296#199296) qualifies for the bonus internet points!
---
Standard loopholes are forbidden by default.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so shortest solution wins! If you enjoy the challenge, consider upvoting it... And happy golfing!
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~27~~ ~~25~~ ~~24~~ 23 bytes
```
ÅTαε.āθDÆª}©æε®yKδαOß}à
```
[Try it online!](https://tio.run/##yy9OTMpM/W9k5HZ4gr2Sgq2dgpL9/8OtIec2ntuqd6Tx3A6Xw22HVtUeWnl42bmth9ZVep/bcm6j/@H5tYcX/Nf5H22go2AZyxVtpKNgAWEZ6iiYAjlAljGQBaGgPJC0GYRnBuEZQxRDOECWGZACmggxA6jGHG4migVGQMocRQBiFZAygZtgDDHOCGwW1GpzIGUCpywgmk3AKsxjAQ "05AB1E – Try It Online")
Outputs 2 for falsy and a larger integer for truthy. Works for any triangle number of pins, thus qualifying for the bonus internet points.
A set of pins is split if and only if there is a partition of the set of pins in two subsets A and B such that no pin in A is adjacent to a pin in B.
Adjacency is determined using [3-element hexagonal coordinates](https://www.redblobgames.com/grids/hexagons/#diagram-grid-cube).
First, we convert the input pins to their hex coordinate triplets:
```
   ε      }     # for each pin in the input:
ÅT              #  list of triangle numbers <= pin
  α             #  absolute difference of each one with pin
    .ā          #  enumerate: [a, b, c] => [[a, 1], [b, 2], [c, 3]]
      θ         #  get the last pair
       D        #  duplicate
        Æ       #  reduce the copy by subtraction
         ª      #  append that to the pair
```
Then, we iterate over partitions of this set of triplets in two subsets:
```
©               # save the set in the register
 æ              # powerset (list of subsets)
  ε       }     # for each subset y:
   ®            #  push the set from the register
    y           #  push y
     K          #  set difference (=> y's complement)
```
Then, we compute the 2D list of distances between each pin in the first subset and each pin in the second subset. Thanks to the elegance of 3-element hexagonal coordinates, this is surprisingly easy:
```
      δα        #  double vectorized absolute difference
        O       #  sum each triplet
```
Finally, we answer the question:
```
         ß      #  minimum distance for the current partition
          }     #  end the loop
           à    # maximum of the list of minimums
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~72...~~ 74 bytes
```
->l{*r=l[0];l.map{r.map{|w|r|=l&"zê-ǓᔂYMŰɃc"[w].ord.digits}};l&r!=l}
```
[Try it online!](https://tio.run/##jY9NTsMwEIX3OYXxooJqEqW2Yzuqwg1YskCWF6VVUYURkduqgSYbOAKcghV3QAhxDE6S@qetYIcXfu957JnPdn390M@rPj0326GtjMr12GR3k3prw95uWttWZoAfP97Sr5ef16eri8/37@cpVhud3dtZNlvcLFbLrhubgT2pTNcrlQMqNSgCSEY3AlS44Bx1Lso@@TKPicdE4@UYnOOhAQEJ/iCHERTAQbikI2LT1kg1MFeN1l1Sr1dLhFO/cKL8aOKeid8sJEI4YaEjcmc0DiJh@B5KOGFHkaFMgQUsAfEDB@crB@8Z/yZyTMyz/4M8cZURIUAoA1YA4wIKKiTIEoQAyiUUooSy1Fk9md6e4sshPkv6HQ "Ruby – Try It Online")
### What is that?
Starting from the first pin in the list, check if all pins can be reached within a finite number of steps.
The binary string "zê-ǓᔂYMŰɃc" is the UTF-8 encoding of the adjacency list [122,234,45,467,5378,89,77,368,579,99]. Some digits are repeated to make the numbers fit into the ASCII range and spare some bytes, some edges are omitted if the node can be reached through different paths.
Thanks Value Ink for smoothing out rough edges (-3 bytes).
[Answer]
# JavaScript (ES6), ~~87~~ 83 bytes
*Saved 4 bytes thanks to @Grimmy*
Takes input as a 10-bit integer (LSB = pin \$0\$, MSB = pin \$9\$). Returns a non-zero integer for a split spare, or \$0\$ otherwise.
```
n=>(g=m=>[6,29,51,210,430,788,136,344,688].map((v,i)=>m|=m>>i&1&&n&v)|m)(g(n&-n))^n
```
[Try it online!](https://tio.run/##lZLBjoIwEIbvPoUnbJNRGWlLOcCLuG7CusqykWLENdnEd2eRghYdTbaHXvr1n3/@me/0lFbrQ74/Tk35uam3cW3ihGVxESdLBYsIJMICfRCBD6HWgIGCQAhQWq9mRbpn7AQ5j5PiHBdJknvoecY78XPBWcaMNzWcv5t6XZqq3G1muzJjk@Xx8HP8@l1N@Gg@Hw9OpEMlRdAUHLlftsz/QL87yPm4@edD9MhYqLktswBNUJd3bDFLIUjQj1RLXDhLBSBJJX/A6Ce@XYZ01LVnGUXr3DF0/3ee6QQaDB0tCYqohy2D17wvOSkIX@R@S9QmPwAnb2a5TXfVfwffj90RJwz062GZ8Fnb7exdm5Kuh@4SCTLAFnLCCcgQO/CqJUlfeDfakGK6BbCMoJiu3I3RpI5dkz4D0XgK6z8 "JavaScript (Node.js) – Try It Online")
### How?
Starting with the lowest bit set in the input, we progressively expand a bitmask with the pin neighbors. We eventually compare the result with the input.
Because we expand from pin \$0\$ to pin \$9\$ (let's call them \$P\_0\$ to \$P\_9\$), a single pass would occasionally miss a connection. Fortunately, processing two passes is always enough for all possible paths, which is what this code is doing.
For instance, let's consider the following configuration:
```
6 - - -
 3 4 -
  - 2
   -
```
**First pass**
We start with \$P\_2\$, which expands to \$P\_4\$. Then, \$P\_4\$ expands to \$P\_3\$. The connection between \$P\_3\$ and \$P\_6\$ is missed because \$P\_3\$ is not included in the bitmask at the time it's processed.
**Second pass**
Again, we start with \$P\_2\$, which expands to \$P\_4\$ (no change). Then, \$P\_3\$ expands to \$P\_4\$ (no change) and \$P\_6\$, which completes the bitmask.
### Improvement
As pointed out by @Grimmy, we never need to expand from \$P\_9\$: when we reach it, its neighbors (\$P\_5\$ and \$P\_8\$) have necessarily been found already. Therefore, we can safely discard its neighbor bitmask and iterate only from \$P\_0\$ to \$P\_8\$.
### Commented
```
n => (                // n = input bitmask
  g = m =>            // g is a recursive function taking a mask m
    [                 //   lookup table:
             6,       //     neighbors of pin 0
           29,51,     //     neighbors of pins 1, 2
        210,430,788,  //     neighbors of pins 3, 4, 5
      136,344,688     //     neighbors of pins 6, 7, 8
    ]                 //   
    .map((v, i) =>    //   for each value v at position i in the above array:
      m |=            //     update m:
        m >> i & 1 && //       if the i-th bit is set in m:
        n & v         //         m = m OR (n AND v)
    ) | m             //   end of map(); return the new value of m
)(                    // invoke g twice to support the longer paths,
  g(n & -n)           // starting with the lowest bit set in n
) ^ n                 // compare the result with n
```
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), ~~106~~ 121 bytes
Defines a function `P.__contains__` that takes a set of pins and returns `False` for a split spare or `True` otherwise.
e.g. `P.__contains__({"0", "9"})` returns `False` while `P.__contains__({"0", "1"})` returns `True`
```
d="6310214374254859876"
P={*map(frozenset,zip(d,d[1:]))}
while P<(P:={a|b for a in P for b in P if a&b}):0
P.__contains__
```
[Try it online!](https://tio.run/##dZHRaoMwFIbv8xSHXkwtMtTEJJX5Dt6XIjqVBrYoGhir89ldE10XkebqfP/JyfnD332raysx7/p5rtIDxWEQhQQzEsWExyfO6AFl6Xj8LDq36dtbLYda@TfRuZVfncPk4nkT@rqKjxqyNzdL0rH4KaFpeyhASMhMWS6laKB4KScvCVD2mufvrVSFkEOez6oe1AApnBGMTuD44JycydcQaeC2EmqIF3lR8KJYsOn8DVK7Q@0Otp60ZKPQFYyr/91mnu18PbEbrcCeta0PGCC7rdg2Ez18bD7HViA74PY68pi@30EXpCPSCeiUTBIJgvvpeiGVqwUftnkZ0fPmXw "Python 3.8 (pre-release) – Try It Online")
[Answer]
# [C++ (gcc)](https://gcc.gnu.org/), ~~381~~ \$\cdots\$ ~~267~~ 248 bytes
```
#import<set>
using S=std::set<long>;int f(S s){std::set<S>c;for(long b=0x5792628a5a065664;b>9;b/=10)c.insert({b%10,b/10%10});for(S i:c)for(S j:c){S q(i);q.insert(begin(j),end(j));if(q.size()<i.size()+j.size())c.insert(q);}return c.find(s)==end(c);}
```
[Try it online!](https://tio.run/##jVJRb4IwEH7nV1xcltCMOUQFtcCf4HXJArWaGi1Iy7KM8NvdFYvosofx8n3Xu/vu61FWVa97xi6XJ3GqylrHiuvUaZSQe8gSpbebDZ7Ex1LuUyqkhp2bgSLtLZOljO7K2jUVUCT@1zJaB2Gwype5Hy7DcEGLdE2Lt2TmEzYVUvFau23xPPO94m3mI3akF8hAbBi5sgOyNoOzKwg9D00F3wvpHojH5RaBULFzz1MlvrlLYmHJy8GScdiZ0K7muqklsOlOYLMiSWJEGGbw4pIdmy2HWJRK1zw/pc549smZLuthIzI/cVXljAPenzpmH6ccTZHWuRbGt2WloKqj0B@aK60ggRZa34N150EbeLCydObBEiND50gtDnFfEto4tPH82mIjpKFB1L5qYVk0ig@joKN/OGSllHh479H0mN7owWNgvSEuxmlzOzvoBw9mI4OLEVdWY9FXRb0V/Mvg5o0uwYze3G2KgAP49c@LlY2GOMYnZ1LE0Mm7nFDnITt5vX198pf2wx3/pd5dfgA "C++ (gcc) – Try It Online")
### Ungolfed
```
#include<set>
#include<algorithm>
using namespace std;
using S=set<int>;
bool f(S s) {
    // Change array a for any number or shape of pins,
    //  instead of just a triangle of 10.
    // It lists all the pins next to all their adjacent pins.
    int a[]{6,3,1,0,2,1,4,3,7,4,2,5,4,8,5,9,8,7,6};                                                                                                              
    set<S> c;
    for(int i=0;i<sizeof(a)/sizeof(int)-1;++i) 
        c.insert({a[i], a[i+1]});
    set<S> t;
    // Keep on adding connected sets of pins until there are no more new ones.
    while (t!=c) {
        for (auto i:c)
            for (auto j:c)
                if (any_of(begin(i),end(i),
                   [&](auto e){return j.find(e)!=end(j);}))
                {
                    S q(i);
                    q.insert(begin(j),end(j));
                    t.insert(q);
                }
        swap(t,c);
    }
    return c.find(s)==end(c);
}
```
Builds a set of all connected pin sets as per [Kyle Gullion](https://codegolf.stackexchange.com/users/32604/kyle-gullion)'s idea and then simply tests for membership.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 47 bytes
```
ＵＯ⁸#Ｆθ«≔⌊⊘⊖₂⊕×⁸ιηＪ⁺³⁻⊗ι×η⁺²η⊗ηＵＯ²ψ»¤#≔›⁶⁴ＬＫＡη⎚η
```
[Try it online!](https://tio.run/##RY5BT8JAEIXP9Fds8DJN1guo0XAiEkSjsVFuhMNSh3bjdEemWxJj/O3rUFDn9GbmvZevrJ2U7Cil5w1xqODamuHZMJ9kWxYDu9x8ZYNp2/oqwJyYBRaO9vgGMywFGwxR9euuc4IvzBHuw/956RtsD4U@78eaWnsHD13zsWQoqGthbM2TDypm3G1IM15dx1xtTW8ZHWJ9@tejq9acePX9qet3NvdEcEQ/8d4JuogCVxfWPGKoYg0F4vtUfX80t4ROQEUhPkStnqS0WinWpTVKfrNep/M9/QA "Charcoal – Try It Online") Link is to verbose version of code. Takes input as an array of integers and outputs a Charcoal boolean, `-` for a split spare, empty output otherwise. Explanation:
```
ＵＯ⁸#
```
Draw an 8-by-8 rectangle of `#`s.
```
Ｆθ«
```
Loop over the input pins.
```
≔⌊⊘⊖₂⊕×⁸ιη
```
Calculate the row of the pin.
```
Ｊ⁺³⁻⊗ι×η⁺²η⊗η
```
Jump to the position of the pin.
```
ＵＯ²ψ
```
Erase a 2-by-2 rectangle representing the pin.
```
»¤#
```
Fill with `#`s starting at the last pin.
```
≔›⁶⁴ＬＫＡη
```
See whether the fill restored all 64 `#`s.
```
⎚η
```
Clear the canvas and output the result.
Although I calculate the position of the pin directly (I tried a look-up table but it was the same byte count) this method won't handle arbitrary numbers of pins since it needs to be able to draw a large enough initial rectangle. However it can be adjusted to handle a specific maximum number of pins: the initial `8` needs to be increased by 2 for each additional row of pins, the `3` needs to be one less than the new number of rows of pins, and the `64` needs to be the square of the number that replaces `8`.
[Answer]
# Excel (Ver. 1911), 142 Bytes
```
A1     'Input
B1:B10 3ÒƮ̔ŘʰĠ 'one character per row
       ^^^ (Non-printing characters)
C1     =ROW(B1:B10)-1
D1     =BITAND(INT(A1/2^C1#),1)*UNICODE(B1:B10)
E1     =SUM(MMULT(N(BITAND(2^C1#,TRANSPOSE(D1#))*D1#>0),N(C1#>=0)))+2<2*SUM(N(D1#>0)) 'Output
```
Here un-golfed using named ranges and extra columns
```
Input         'Input
Bit_List      3ÒƮ̔ŘʰĠ 'as a column of chars
Pin_Num       =SEQUENCE(ROWS(Bit_List))-1
Unicode       =UNICODE(Bit_List)
Pins_Left     =BITAND(INT(Input/2^Pin_Num),1)*Unicode
Pins_Adjacent =MMULT(SIGN(BITAND(2^Pin_Num,TRANSPOSE(Pins_Left))*Pins_Left),SIGN(Pin_Num+1))
Split         =SUM(Pins_Adjacent)<2*(SUM(SIGN(Pins_Left))-1)
```
[Try it offline!](https://drive.google.com/file/d/0B3c4lsZDmcHuVzdtWnZmWURJYWxnQ00zR3BXWkdjUUlUay1N/view?usp=drivesdk) (link to the workbook in a google drive)
You'll need to download and open in the latest version of excel for the formulas to work.
Single Test+Comments screenshot
[![Test+Comments](https://i.stack.imgur.com/N8sdh.png)](https://i.stack.imgur.com/N8sdh.png)
]