> For the complete documentation index, see [llms.txt](https://pahutyakv.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pahutyakv.gitbook.io/docs/randomly/.enum.md).

# .Enum

`Randomly.Enum` provides random selection from enums with options for multiple values or exclusions.

***

### <mark style="color:$success;">Value</mark>

* `Value()` – Returns a random value from the specified enum type.
* `Values(count, unique = true)` – Returns a list of random values from the specified enum type.

***

### <mark style="color:$success;">Except</mark>

* `Except(excluded)` – Returns a random enum value excluding specified values.

***

{% code title="Example.cs" %}

```csharp
enum Direction { Up, Down, Left, Right }

// Multiple unique enums
List<Direction> randomDirs = Randomly.Enum.Values<Direction>(3, true);

// Random enum excluding some
Direction notUp = Randomly.Enum.Except<Direction>(Direction.Up);
```

{% endcode %}
