---
title: Randomness
description: "Common examples of working with random numbers, uncertainty, and randomness in general"
---

This page lists examples of working with random numbers, uncertainty, and randomness in general.

## How to generate a random number

```tact
// Declare a variable to store the random number
let number: Int = 0;

// Generate a new random number, which is an unsigned 256-bit integer
number = randomInt();

// Generate a random number between 1 and 12
number = random(1, 12);
```

:::note[Useful links:]

  [`randomInt(){:tact}` in Core library](/ref/core-random#randomint)\
  [`random(){:tact}` in Core library](/ref/core-random#random)

:::

:::tip[Hey there!]

  Didn't find your favorite example of working with randomness? Have cool implementations in mind? [Contributions are welcome!](https://github.com/tact-lang/tact/issues)

:::
