---
title: "init(forDieWithSideCount:)"
framework: gameplaykit
role: symbol
role_heading: Initializer
path: "gameplaykit/gkrandomdistribution/init(fordiewithsidecount:)"
---

# init(forDieWithSideCount:)

Creates a random distribution equivalent to a die with the specified number of sides.

## Declaration

```swift
convenience init(forDieWithSideCount sideCount: Int)
```

## Parameters

- `sideCount`: The count of sides for modeling a die; that is, the highest integer value for the random distribution to generate.

## Return Value

Return Value A uniform random distribution that produces values in the range [1, sideCount].

## Discussion

Discussion Creating a random source with this method is equivalent to calling the init(randomSource:lowestValue:highestValue:) initializer, passing a new instance of the GKARC4RandomSource class for the source parameter, and passing 1 and sideCount for the lowestValue and highestValue parameters. Because the newly created distribution uses its own GKRandomSource instance, the random behavior of the distribution is independent from that of other randomizers.

## See Also

### Creating Specific Random Distributions

- [d6()](gameplaykit/gkrandomdistribution/d6().md)
- [d20()](gameplaykit/gkrandomdistribution/d20().md)
