[Question]
  [
A [standard domino set](https://en.wikipedia.org/wiki/Dominoes) has 28 unique pieces:
[![enter image description here](https://i.stack.imgur.com/7LxZh.png)](https://i.stack.imgur.com/7LxZh.png)
Given a list of 28 or fewer unique dominoes, output the list required to make a complete set.
Input and output dominoes are specified by two digits - the number of pips on each side of the domino, e.g. `00`, `34`, `40`, `66`.
The digits may be given in any order, so `34` is the same domino as `43`
### Example Inputs
```
00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 33 34 35 36 44 45 46 55 56 66
00 10 11 20 21 22 30 31 32 33 40 41 42 43 44 50 51 52 53 54 55 60 61 62 63 64 65 66
00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 34 35 36 44 45 46 55 56 66
00 02 03 04 05 06 11 13 14 15 16 22 24 25 26 33 35 36 44 46 55 66
<empty list>
```
### Corresponding Example Outputs
```
<empty list>
<empty list>
33
01 12 23 34 45 56
00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 33 34 35 36 44 45 46 55 56 66
```
  
[Answer]
## CJam, 11 bytes
```
{:$7Ym*:$^}
```
An unnamed block (function) with I/O as a list of pairs of integers.
[Test it here.](http://cjam.aditsu.net/#code=qN%2F%7B%3A~2%2F%0A%0A%7B%3A%247Ym*%3A%24%5E%7D%0A%0A~p%7D%2F&input=00%2001%2002%2003%2004%2005%2006%2011%2012%2013%2014%2015%2016%2022%2023%2024%2025%2026%2033%2034%2035%2036%2044%2045%2046%2055%2056%2066%0A00%2010%2011%2020%2021%2022%2030%2031%2032%2033%2040%2041%2042%2043%2044%2050%2051%2052%2053%2054%2055%2060%2061%2062%2063%2064%2065%2066%0A00%2001%2002%2003%2004%2005%2006%2011%2012%2013%2014%2015%2016%2022%2023%2024%2025%2026%2034%2035%2036%2044%2045%2046%2055%2056%2066%0A00%2002%2003%2004%2005%2006%2011%2013%2014%2015%2016%2022%2024%2025%2026%2033%2035%2036%2044%2046%2055%2066%0A)
### Explanation
```
:$   e# Sort each pair in the input.
7Ym* e# Get all pairs with elements in range [0 .. 6] using a Cartesian product.
:$   e# Sort each pair.
^    e# Symmetric set-difference. This will remove all pairs that are in the input
     e# and also remove duplicates, because it's a set operation.
```
[Answer]
## Pyth, ~~12~~ 10 bytes
```
-.CU7 2SMQ
```
Input and output in format `[[0, 0], [0, 1], ...]`.
```
   U7       generate range [0, 1, ..., 6]
 .C   2     all combinations-with-replacement of 2, generates [[0,0],[0,1],...]
         Q  get the input
       SM   sort each domino (turns ex. [1,0] into [0,1])
-           remove the map-sort'd input from the full array
```
[Try it here.](https://pyth.herokuapp.com/?code=-.CU7+2SMQ&input=%5B%5D&debug=0)
Thanks to [@MartinBüttner](https://codegolf.stackexchange.com/users/8478/martin-b%c3%bcttner) for saving 2 bytes with a different input/output format!
[Answer]
## JavaScript (ES7 proposed), ~~80~~ 76 bytes
```
s=>[for(n of d="0123456")for(o of d.slice(n))if(s.search(n+o+'|'+o+n)<0)n+o]
```
Takes input as a space-separated string and returns an array of strings. Array comprehensions really pull their weight for this one.
[Answer]
# Ruby 74 bytes
```
->b{a=(0..27).map{|i|"%d%d"%[i%7,(i+i/7)%7]}
b.map{|e|a-=[e,e.reverse]}
a}
```
Takes an array of strings, returns an array of strings.
**Commented in test program**
```
f=->b{a=(0..27).map{|i|"%d%d"%[i%7,(i+i/7)%7]} #generate complete set of dominos (each domino once) and store in a
b.map{|e|a-=[e,e.reverse]}                     #remove provided dominos (check both forward and reverse representations)
a}                                             #return a
p f[%w{00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 33 34 35 36 44 45 46 55 56 66}]
p f[%w{00 10 11 20 21 22 30 31 32 33 40 41 42 43 44 50 51 52 53 54 55 60 61 62 63 64 65 66}]
p f[%w{00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 34 35 36 44 45 46 55 56 66}]
p f[%w{00 02 03 04 05 06 11 13 14 15 16 22 24 25 26 33 35 36 44 46 55 66}]
p f[[]]
```
**Output**
```
[]
[]
["33"]
["01", "12", "23", "34", "45", "56"]
["00", "11", "22", "33", "44", "55", "66", "01", "12", "23", "34", "45", "56", "60", "02", "13", "24", "35", "46", "50", "61", "03", "14", "25","36", "40", "51", "62"]
```
In the last example (input empty list) note the order of generation of the complete list of dominoes using modular arithmetic. 7 Doubles are generated first, then 7 dominoes with a difference of 1 (or 6) pips between each side, then 7 dominoes with a difference of 2 (or 5) pips, and finally 7 dominoes with a difference of 3 (or 4) pips.
[Answer]
# [Julia 0.6](http://julialang.org/), 47 bytes
```
A->setdiff([[i,j]for i=0:6 for j=i:6],sort.(A))
```
[Try it online!](https://tio.run/##LY9NisJAGET3nqLIxg7E4ftfCBnwHCELwQm0ZNpg4vmdtMzuLapeUffXnK/xvvXvy@l7/dlueZrSMOTuPk6PJ3JP50Cle5/PMXbr47l9pUvbvqe0tv0wlIHH05GOXRnkA@MnXpAL1mXO2x4bD4ff65L2heWZyzaXdEtTlbQdUkMEYpCAFGQgBwWYwQJWsIEdHBCBKMQgDgmoQR0aMIM5LOAOD0Q0HaqTqUqEIFy7SlCG7qAwgjFMYFrrTnCGC1zhVj1BCEYIQhGG8H9ts//@Aw "Julia 0.6 – Try It Online")
*(Corrected range start thanks to JayCe.)*
---
## 48 bytes
```
A->[(i,j)for i=0:6 for j=i:6 if[i,j]∉sort.(A)]
```
[Try it online!](https://tio.run/##LY1NaoNQFEbnWcVHJnkPTLn/g4KFrEMcBILwxBpRu4d2m92I1dDZge@ec/uvodxje9Tb7frRpFL1uXvOKDW9Bw7q67JT6Zp9an@/f5bnvL6lW263Li25bpqx4fZ6oUs1NvKC9uWNKCOWaSjrftaeTp/3Ke0vprmM6zCmR@r2SM4V0pkIxCABKchADgowgwWsYAM7OCACUYhBHBJQgzo0YAZzWMAdHog4VziaTEdECMKHqwRl6A4KIxjDBKaH7gRnuMAVbkcnCMEIQSjCEP6fPee8/QE "Julia 0.6 – Try It Online")
[Answer]
# Perl, 48 + 1 = 49 bytes
```
for$=(0..6){for$.($=..6){/$=$.|$.$=/||say$=.$.}}
```
Requires the `-n` flag, and the free `-M5.010`|`-E`:
```
$ perl -nE'for$=(0..6){for$.($=..6){/$=$.|$.$=/||say$=.$.}}' <<< '00 02 03 04 05 06 11 13 14 15 16 22 24 25 26 33 35 36 44 46 55 66'                      
01
12
23
34
45
56
```
Pretty boring answer overall, but here goes with an ungolfed version:
```
# '-n' auto reads first line into `$_`:
# $_ = <>;
foreach $a (0..6) {
  foreach $b ($a..6) {
    say $a . $b unless $_ =~ /$a$b|$b$a/;
  }
}
```
[Answer]
# [Python 2](https://docs.python.org/2/), 91 bytes
```
lambda A,S="0123456":sum([[i+j for j in S[int(i):]if(i+j in A)+(j+i in A)<1]for i in S],[])
```
**[Try it online!](https://tio.run/##JYxLCoNAGIP3PUVw4wyKzHshdeEZXFopliL9Bx3FB6Wnt9quknwJmT7rawxq74rb3rfD49miTKsiElJpY12UL9vA6poSj26c4UEBVU1hZcTzhjp2NgcrecJ8Qn97lc05/qWqSeuG72Uxt@87hWlbGc@WqadDL9N8PMWIMz9SYB0rOd@FgFAQGsJAWAgHKSE1pIG0kA5KQRkoC@WgNbSFdjAGxsFaOPcF "Python 2 – Try It Online")**
[Answer]
# [JavaScript (SpiderMonkey)](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/45), 69 bytes
```
s=>[for(n of d="0123456")for(o of d)if(n<o<!s.match(n+o+'|'+o+n))n+o]
```
[Try it online!](https://tio.run/##HchBbsIwEEbhq/ywiS0EGo9nZkV6kYpFFOI2LXhQjCpV4u4pZfOk930NP0Mbl/l237fbfJ6Wq9fv6Xct/dr6t/fiS6jwgnO/pcRZ1LbxH/2FcS6hHv24aYfrcB8/Q935rnt0z9YYn3NaR6/NL9Ph4h@hhI4IlEAMyiABKciQEhIjCZIiGZjBGSxgBRtyRhZkRTaIQBRiUIUazLoY1z8 "JavaScript (SpiderMonkey) – Try It Online")
optimized from Neil's
[Answer]
# [R](https://www.r-project.org/), 111 bytes
```
function(s,p=paste0,L=lapply)setdiff(p(sequence(1:7)-1,rep(0:6,t=1:7)),L(L(strsplit(s,''),sort),p,collapse=''))
```
[Try it online!](https://tio.run/##tZJNagQhFIT3c5FWMODzLzDgDfoSjVHS0HQbdRZz@o61MANhQiCQTfFefWAVajmTP9NtD209dlZF9nmpLUox@23JebvzGtvbmhLLrMaPW9xDZHR95S8kSsxMXp1oHgYXM5tZbaXmbW39qGnioh6lcZFFOLZ@XI2@m/xMLLBJyklMkiAKoiEGYiGuC4ESKIESKIESqAJQAApAASgADU/D0/A0PIPVYDVYLSaLybne6HJ5VCI5khUmRSNKY9VYtRopBp6BZ@AZPaIsgAWwABbAmpHsQB2oA3WgDtTZZ5X@55b@ekG/FPmxw7NH@hb/lfwIfV/KElosrP@bTw "R – Try It Online")
Not really proud of this, but R is not very "golfy" in splitting/concatenating strings...
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~12~~ 11 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
6Ýã€{JI€{KÙ
```
-1 byte thanks to *@Emigna*.
[Try it online.](https://tio.run/##HYqxDYAwDATHcUNhx4l3AEZAFERiCjq2oKCiZYtswiIm7@b0Ph@Xrcrubu1uz3e@xzSCc7vcF2KmgViABGhHDlcA6xA4yQCcIU6IU8Sx0ClORafRxTcWXIlltP4)
**Explanation:**
```
6Ý         # [0,1,2,3,4,5,6]
  ã        # Duplicate and take the cartesian product (pair up each)
   €{      # Sort each pair
     J     # Join them together to strings
I€{        # Sort each pair-string of the input
K          # Remove all pairs from the input from the cartesian list
Ù          # Only leave unique values
```
[Answer]
# Mathematica, 49 bytes
```
Complement[Join@@Table[{x,y},{x,0,6},{y,0,6}],#]&
```
Input is list of list of integers.
[Answer]
# Java 8, 105 bytes
A void lambda accepting a mutable `java.util.Set<String>`.
```
s->{for(int i=0,a,b;i<49;)if(s.add(""+(a=i/7)+(b=i++%7))&(s.add(""+b+a)|a==b))System.out.print(" "+a+b);}
```
[Try It Online](https://tio.run/##nZJPj9owEMXP4VM8RWoVK5D6/6pAkKpeemhPHFeryglhawoJis1Wqy2fnTqhAkpZqerBdpR5/s2M563MkxmtFt8P212xtiXKtXEOX4yt8TKIfv903vhwrII223m7zpa7uvS2qbOPTe12m6qdnmPzyk/nvrX142yGJfLBwY1mL8umTWztYXM6NMNiYqfy/YTYZeIys1gkcZwmJrfv7kiaFLlN0zd3hLw9B4vUkJ8mzwtC5s/OV5us2flsG7L4JEacmrQgk/1hEE0G11U/NXaBTWgoOVZ1/wDTPjrS9RfdLDsoSuMqhxzJKwJy8Rgf2tY8u8z5tjKbJECjuvqBU7IuTRTFlIIyUA4qQCWoAtVgDIyDCTAJpsA0OAcX4BJcgWsIASEhFISGlJAKUkMpKA2t4@EJzWjH4hScdQhBIRgE7@5LCskgOaToEIpCMSgOJaBkx9IUmkFzaAEtodWf6P@p@l9KvgG9Il4@wgnXs86g47kPG@k@so3ZJg6jGcJAtmvbu4OcQ9dTG4@N@2ydv6X4ZNy3i6GPx2GsR51v@tt/a@8fTqpJWMH0rzioN9hXjI9GO3oxWmamLKutT/og6QjRtdvXddIHQsf7wf7wCw)
## Ungolfed
```
s -> {
    for (int i = 0, a, b; i < 49;)
        if (
            s.add("" + (a = i / 7) + (b = i++ % 7))
            & (
                s.add("" + b + a)
                | a == b
            )
        )
            System.out.print(" " + a + b);
}
```
## Acknowledgments
* -1 byte thanks to Jonathan Frech
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
Ṣ€7ḶŒċ¤ḟ
```
[Try it online!](https://tio.run/##DcirDcJQGIDRVb4R/jebsAGGdAEsBoGrwpEQJApBWgt0kMsilyZHnf1uGA69t/n2Oz42bXot4/f8vrfp2tv03K65@pyWsc2X3kUQQxwJJJFCFXU00EQLMyywxAp3PPEigigyqfoD "Jelly – Try It Online")
Argument is a list of length-2 lists of integers. The footer transforms the input from the format in the test cases to the format this solution accepts.
[Answer]
# J, 26, 24 bytes
*-2 bytes thanks to FrownyFrog*
```
(;(,.i.,])&.>i.7)-.\:~"1
```
* `(;(,.i.,])&.>i.7)` calculates the full set (this part could be golfed further, I believe. And please do if you see how...)
* `-.` is "set minus"
* `/:~"1` orders each of the inputs
[Try it online!](https://tio.run/##FYuxDsIwDET3fMWpA22k1GqdNEhBsCAxMTG3YkBULQt/wK8Hn2w/@c6@T22kXXEuaBEwoNj0guvjfqvdqQuyS1j8QS67HH0vc/k1Y/XOufdr@2LFU5fZIgOslYhEIiYiA6OVdSQSMRF2UCaUntJTepF/kTJSJl4Tt4leRq5/ "J – Try It Online")
## Original
[Try it online!](https://tio.run/##FYu9DsIwDIT3PMUpDG2kNm1@kcLPgsTExAxiqKiAhQdAyqsHn2x/8p19n6Ztt@JQ0GHAjCIzWpyul3Pr@03dl0k7cxx@u/q2WzPaqVTtmlFKPZfXFyse/n6T0AxpTwQiEonIgJOSDkQkEiEHz4Sn5@l5eoF/gTJQRl4jt0QvI7c/ "J – Try It Online")
```
((#~<:/"1)>,{;~i.7)-./:~"1
```
[Answer]
# Python 2, ~~89~~ 86 bytes
Saved a few bytes by simplifying domino set generation.
```
lambda z,s="0123456":{x+y for x in s for y in s[int(x):]}-{(a+b,b+a)[a>b]for a,b in z}
```
[Try it online!](https://tio.run/##vZLLaoNAGIXX8SkGV4oWnOtCMC9iXYy00kBrQnShCXl2k/kgtdALhUI3h99zPpzDzH@Yx5d9r5auelxe/Vv75MUpH6q4kEob6@LyPGWz6PZHMYldLwbGmbHe9WMypWVzeTgnPmvzNvNp7bdtExift4E6XZbxeRgHUYmkjosizsXt36hCNWpQi7qgEkbCSBgJI2EkjCJVpIpUkSpSja/xNb7GNzgGx@BYZsvsXNzk0Ubcu8pibaOYlVzP1jgaR6v1VINv8A2@0evZltSSWlJLas3axsE4GAfjYByMs191/ad7/eON/qrfz82@e@vPnT60ee/RpFEUNjTsZVhR9rOMNofjbaFFl4TvdLkC "Python 2 – Try It Online")
Takes a list of strings like ["00", "10", "02] as an argument for the dominoes. Returns python set objects, which are unordered distinct lists.
**Explanation**
```
# anonymous function, s should always have its default value
lambda z,s="0123456":
                     # contents are a set
                     {                                  }
                          # iterate over characters in string
                          for x in s
                                     # for each x, iterate over x from index of current item forward
                                     for y in s[int(x):]
                     # add characters together for domino string
                     x+y
                                                         # contents are a set, return the difference between these two sets 
                                                         -{                          }
                                                             # iterate over items in input list, split strings into two characters
                                                                         for a,b in z
                                                             # sort strings in input list (so that i.e. "10" => "01")
                                                             # essentially, "ab" if a<b, otherwise "ba"
                                                             (a+b,b+a)[a>b]
```
[Answer]
## Haskell, 65 bytes
```
f x=[[a,b]|a<-"0123456",b<-[a..'6'],notElem[a,b]x&&notElem[b,a]x]
```
Usage example:
```
*Main> f ["00","02","03","04","05","06","11","13","14","15","16","22","24","25","26","33","35","36","44","46","55","66"]
["01","12","23","34","45","56"]
```
Iterate `a` in an outer loop over all digits from `0` to `6` and `b` in an inner loop over all digits from `a` to `6` and keep those `ab` where neither `ab` nor `ba` are found in the input string. 
[Answer]
## Seriously, 16 bytes
```
,`S`M7r;∙`εjS`M-
```
Takes input as a list of strings, outputs a list of strings
[Try it online!](http://seriously.tryitonline.net/#code=LGBTYE03cjviiJlgzrVqU2BNLQ&input=WycwMCcsICcwMicsICcwMycsICcwNCcsICcwNScsICcwNicsICcxMScsICcxMycsICcxNCcsICcxNScsICcxNicsICcyMicsICcyNCcsICcyNScsICcyNicsICczMycsICczNScsICczNicsICc0NCcsICc0NicsICc1NScsICc2Nidd)
Explanation:
```
,`S`M7r;∙`εjS`M-
,`S`M             map: sort each input string
     7r;∙         cartesian product of range(0,7) ([0,1,2,3,4,5,6]) with itself
         `εjS`M   map: join on empty string, sort (results in all valid dominoes with some duplicates)
               -  set difference (all values present in valid dominoes set not present in input, with duplicates removed)
```
---
## [Actually](https://github.com/Mego/Seriously/tree/v2), 13 bytes (non-competing)
```
♂S7r;∙`εjS`M-
```
This is identical to the Seriously answer (with the exception of implicit input and `♂S` being a shorter way to short each input string).
[Try it online!](http://actually.tryitonline.net/#code=4pmCUzdyO-KImWDOtWpTYE0t&input=WycwMCcsICcwMicsICcwMycsICcwNCcsICcwNScsICcwNicsICcxMScsICcxMycsICcxNCcsICcxNScsICcxNicsICcyMicsICcyNCcsICcyNScsICcyNicsICczMycsICczNScsICczNicsICc0NCcsICc0NicsICc1NScsICc2Nidd)
[Answer]
# racket
```
(define (missing-dominoes input)
  (filter
   (lambda (n)
     (not (member n (map
                     (lambda (n)
                       (let ((x (quotient n 10)) (y (remainder n 10)))
                         (if (<= x y) n (+ (* y 10) x))))
                     input))))
   (for*/list ([i (in-range 7)] [j (in-range i 7)])
     (+ (* 10 i) j))))
```
]