Dobble Card Game
Dobble (Spot It! in the US) is a speedy observation card game for 2 players or more. During the game, players have to spot the identical symbol between two cards as quickly as possible to collect cards and score points.
The Dobble rule!
Dobble, a visual perception card game suitable for ages 6 and up in which players race to find the one matching image between one card and another. The images may be different sizes and placed on any part of the card, making them difficult to spot. The circular cards. Dobble, a visual perception card game suitable for ages 6 and up in which players race to find the one matching image between one card and another. The images may be different sizes and placed on any part of the card, making them difficult to spot. The circular cards feature an assortment of colorful images of everyday items.
Each card of the deck contains 8 graphical symbols. The deck contains 55 cards in total and there is always one and only one symbol in common between any two cards of the deck.
In order to create a deck of cards to follow this rule we need to apply some mathematical logic.
The mathematics behind the game of Dobble is fully explained on this blog post: http://www.petercollingridge.co.uk/blog/mathematics-toys-and-games/dobble/.
We will base our algorithm based on the following key findings:
If a game of Dobble needs (n+1) symbols on each card, n being a primary number then we will need:
- A collection of n2 + n + 1 symbols
- We will be able to generate n2 + n + 1 unique cards
The Dobble Matrix
To complete this challenge, it may be easier to consider the following Matrix used for a game of Dobble with only 4 symbols per card (n=3).
We will use 32 + 3 + 1 = 13 symbols to generate 13 cards with 4 symbols per card.
This matrix enables us to visualise which symbols will appear on each card and it also enables us to check that any two cards of the deck have one and only one symbol in common.
The real game of Dobble has 55 cards with eight symbols on each card. Note that with 8 symbols per card, it would have been possible to create 57 cards following the Dobble rules (72 + 7 + 1 = 57) . For some reason, 2 cards were dismissed and the actual game only contains 55 cards.
The Dobble Algorithm
For this challenge we have decided to write an algorithm to generate the 57 possible cards for a game for Dobble. The algorithm will be based on the symbols used in the real game. The challenge consists of identifying the 8 symbols to be be used on each of the cards, making sure that the Dobble rule is always respected:
Python Code/Solution
Other challenges you may enjoy...
The Mathematics of Dobble
In this activity we will explore the mathematics underlying the game known as Dobble or Spot It!. (You can play an online version of the mathematically equivalent game, Intersection Detection, here.)Points and Lines in the Plane
Let's start by thinking about the Euclidean plane—a flat two dimensional space that extends without limit in all directions. We can consider this space as being made of infinitely many points, each of which has neither length nor breadth (that is they are zero dimensional), that may (somewhat magically) be connected to form straight lines—geometrical objects with length but no breath (and thus one-dimensional) that extend indefinitely both forwards and backwards in any particular direction.
Given these two most basic geometrical entities in the plane, we have the following important properties: (here, and in all that follows, a line always means a straight line)
- For any pair of distinct points in the plane, there is only a single line that passes through them both.
- For any pair of distinct lines in the plane, either:
- they have a single point of intersection, or
- they are parallel.
What if…?
Now let's do some mathematical research, and ask what happens if we change some the rules.Projective Planes
Think of looking directly along railway tracks, as in the picture opposite. The tracks are parallel, but it seems they will meet in the far distance. (You might also like to think about perspective projection vanishing points in art and technical drawing.)
This leads to the idea that we can say that parallel lines meet at infinity. If we introduce special infinity points into the plane, one for every pair of parallel lines, the properties about lines and points in the plane are simplified (and it's always good to makes things easier right?).
- For any pair of distinct points in the plane, there is only a single line that passes through them both.
- For any pair of distinct lines in the plane, there is a single point of intersection.
Finite Geometry
Click any two lines to see their point of intersection.
Now let's go a step further and make things even simpler. Imagine what might happen if instead of being infinite in extent, the plane held only a finite number of points; indeed only a small number of points.
Specifically, let's suppose there are only 7 points and 7 lines in our entire 'geometry'. (I know it sounds crazy, but bear with me.) Now of course we want things in our finite geometry to be nice and well-behaved, so let's insist that the properties of lines and points highlighted above must still be true. Can you come up with a picture that illustrates the properties of this 7-point geometry?
Click here to see one way to visualise this geometry, the Fano Plane.
How To Play Dobble
You should verify that indeed any two points define a single line, and any two lines intersect at a single point.
So what's all this got to do with Dobble?
What's this got to do with Dobble? Well, these finite projective planes are precisely the mathematical structures that underly the game. And to see how, we will use the app below to build up a set of cards for mini-Dobble.
We start with the Fano plane and 7 symbols to place. Place the symbols by dragging each to any line in the Fano plane, releasing when your desired line is highlighted. In this way a symbol is associated with each line, and a Dobble card is built up at each point, containing the symbols from the lines that intersect at that point.
When complete, each card will have three symbols, but since any two lines intersect only at a single point, there is only a single card that contains any specific pair of symbols, and given any two cards (i.e. two points) there is only a single symbol in common (i.e. the symbol associated with the line that goes through both points).This is exactly what is needed for a set of Dobble cards!
Mathematicians describe the size of a projective plane as it's order, and the Fano plane is a projective plane of order 2. More cards/symbols result from using this exact procedure on a projective plane of higher order. Click here to see a projective plane of order 3 that could be used to generate a 13 card game.
The formula for the number of points in a projective plane of order n is n2+n+1. You can use this formula to answer the following two questions:
- Verify that an order 2 projective plane has 7 points (as we saw with the Fano plane).
- Given that there are 57 symbols in Dobble, what is the order of the projective plane used to generate a full set of Dobble cards?
Dobble Card Game To Buy
- In the Fano plane all the lines are 'straight'—the circle in the middle only looks like a circle to us since we are looking at a representation in the Euclidean plane. However, we can call a set of 3 points a 'circle' if they are not on a line. Further, we can say that any line that contains exactly one point of the circle is a 'tangent' to the circle at that point.
Use selection mode '1' on the interactive Fano plane below to select lines and points, and see if you can convince yourself that at every point of a circle there is exactly one tangent.
This is another nice property of geometry that is conserved in the tiny geometry of the Fano plane. - Do you think the Fano plane might make a good alternative to the usual grid for playing Noughts and Crosses? What about playing a cooperative version where a win is both players forming a line?
Use selection mode '2' on the interactive Fano plane below to explore these possibilities. - Suppose there is a group of 7 representatives who use the Fano plane for voting. Each of them is assigned one of the points in the plane, and they colour the point blue for yes or red for no as their vote. Strangely, the winning outcome is not determined by majority, but rather using the rule 'line wins', i.e. if all 3 points on a line want something, then this is so decided.
Use selection mode '3' on the interactive Fano plane below to see if you can convince yourself that:- It is not possible to have contradictory deciding lines, and
- A deciding line is always achieved.
Dobble Card Game Australia
- points blue and lines red
- alternating red and blue on points only
- repeat clicks cycle through all point colours