Skip to content

Patterns

tiatomee edited this page Feb 16, 2021 · 1 revision

Pick a random value from a set

extern debug_print_int(x: int)

record Value(val: int)

gene [0 Value]
{
	express Value(val: 0)
	express Value(val: 1)
	express Value(val: 2)
	express Value(val: 3)
	express Value(val: 4)
}

gene [x: Value]
{
	call debug_print_int(x: x.val)
}

Because one gene can only run once per iteration, the second gene will be executed with a random Value from the ones available in the environment.

Clone this wiki locally