Enum in Verse
Enum
Enum is short for enumeration, which means to name or list a series of things, called enumerators. This is a type in Verse that can be used for things like days of the week or compass directions.
Enum is short for enumeration, which means to name or list a series of things, called enumerators. This is a type in Verse that can be used for things like days of the week or compass directions.
Click image to enlarge.
direction := enum{Up, Down, Left, Right} Copy full snippet |
Creating an enum: Use the keyword enum followed by {}. If you want to specify initial elements in the enum, add the enumerators between the {}, separated by ,. |
|---|---|
direction.Up Copy full snippet |
Accessing an enumerator: Use . on the enum, followed by the enumerator you want to use. For example direction.Up. |
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.
