ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:randompick

Table of Contents

RandomPick

any RandomPickN(any n1, any n2, …)

any - any type (int, fixed or str)

Description

Randomly picks one of the arguments and returns its value. Designed to mimic decorate's RandomPick function.

As none of the compilers support functions with variable argument counts, RandomPick2 through RandomPick8 are provided.

Examples

str number = RandomPick3("one", "two", "three");
functions/randompick.txt · Last modified: 2017/07/14 18:52 by korshun