## Background

As described here http://www.ericharshbarger.org/dice/#gofirst_4d12, "Go First" Dice is a set of four dice, each with unique numbering, so that:

- Any roll of two or more dice will never result in a tie.
- Any die rolled against any other die in the set has an equal chance of "win/lose" against said die.

Here is the numbering for the four dice mentioned:

```
DICE COUNT: 4
FACE COUNT: 12
D1: 1,8,11,14,19,22,27,30,35,38,41,48
D2: 2,7,10,15,18,23,26,31,34,39,42,47
D3: 3,6,12,13,17,24,25,32,36,37,43,46
D4: 4,5, 9,16,20,21,28,29,33,40,44,45
```

## Question

I stink at math. I'm stumped. Given the above information, **I'd like to be able to generate lists of integers ("dice") given a number of dice.** Such that, example output might look like so (formatted, python console):

```
>>> generate_dice(players=4)
[[1,8,11,14,19,22,27,30,35,38,41,48],
[2,7,10,15,18,23,26,31,34,39,42,47],
[3,6,12,13,17,24,25,32,36,37,43,46],
[4,5,9,16,20,21,28,29,33,40,44,45]]
```

The number of sides here is chosen just for example purposes, because it matches the other example given. The "fairness" of each die is really what I'm looking for.

I assure you this isn't homework. This is simply a determined geek, annoyed by a seemingly trivial puzzle that just won't leave me alone... and for some reason, I can't seem to get it right.

I'm sure there's some relatively trivial math, and a basic algorithm involved here, and that's what I'm looking for. What terminology should I search for, if this is obvious to you? Because to me, it's not.

Ideally the solution would be in Python, but I can also read PHP, Javascript, some Ruby, quite well.

`X`

is divisible by`N`

. Otherwise, one or more of the dice will be lopsided.8more comments