4 ms·
There is a great explanation of the math - which is MUCH simpler to follow - at stackoverflow [1] (I have converted that into a JS method for all the golfers
by sam_goody 5y ago
There is a great explanation of the math - which is MUCH simpler to follow - at stackoverflow [1]
(I have converted that into a JS method for all the golfers here [2])
But there is more to it than just figuring out what pictures go on the card.
What's the math to make each image have a unique size? [In Dobble, there are eight images on a card and no two images are the same size. Each image is presented seven times, and the size differs each time.]
How do you ensure unique image rotation (which varies similarly to the size)? How to do collision detection so that all the images don't overlap?
Also, there are the variations. For example, what is the math to have all images matching EXCEPT one (I have seen this game for sale)?
It's fun stuff, but there is more work to do than just what the article reflect.
BTW, I would love it if someone has algorithms for the questions I raised. I have been meaning to make a SpotIt! with images of the youth in the group I work at - it would be a unifying present to give out on a overnight.
[1]: https://stackoverflow.com/a/47130477/87520 https://stackoverflow.com/a/47130477/87520
[2]: https://stackoverflow.com/a/67409457/87520 https://stackoverflow.com/a/67409457/87520