I’m making a card game and I need to previously create the cards and store them in a mysql table. I’m trying to figure out how to make a php script to create them.
Well, there are 6 categories of values that vary from 0 to 12 and every card has values for each category. The sum of the values of the categories in each card MUST be 36. So each card is something like this:
- 6 – 9 – 2 – 10 – 6 – 3
OR
- 0 – 12 – 0 – 12 – 0 – 12
OR EVEN
- 6 – 6 – 6 – 6 – 6 – 6
I think if I could randomly generate like 50 or 60 cards it wold be awesome.
Thanks in advance.
A really naive approach is:
I think this will perform well enough for a ‘simple card game’.