Dobble is a monomatch game where you need to find the matching symbol in the two cards that are shown. Every card contains a symbol that will match with a symbol on any other card. Check out the official game here!

The algorithm

This is an example of how to make your own dobble deck! Read more in this article.

    //order of plane, must be a prime number
    let n = 7

    //order of plane + 1                 
    let numOfSymbols = n + 1 

    //the deck of cards
    let cards = [] 

    function createDeck(){
        let i, j, k;

        //the current card we are building
        let card = []; 

        //to start, we build the first card
        for (i = 1; i<= n+1; i++) {


        //then we build the next n number of cards
        for (j=1; j<=n; j++) {
            card = []
            for (k=1; k<=n; k++) {
                card.push(n * j + (k+1))

        //finally we build the next n² number of cards
        for (i= 1; i<=n; i++) {
            for (j=1; j<=n; j++) {
                card = []
                for (k=1; k<= n; k++) {

Learn more

If you want to learn more about how the game works and the maths behind it check out this video from Stand-up Maths.


javascript dobble

loading images...