<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKRandomDistribution/init(forDieWithSideCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKRandomDistribution(cm)distributionForDieWithSideCount:"
  },
  "title" : "init(forDieWithSideCount:)"
}
-->

# init(forDieWithSideCount:)

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

```
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

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

## Discussion

Creating a random source with this method is equivalent to calling the [`init(randomSource:lowestValue:highestValue:)`](/documentation/GameplayKit/GKRandomDistribution/init(randomSource:lowestValue:highestValue:)) initializer, passing a new instance of the [`GKARC4RandomSource`](/documentation/GameplayKit/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`](/documentation/GameplayKit/GKRandomSource) instance, the random behavior of the distribution is independent from that of other randomizers.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)