0

Can you use

irandom(-10,10)

to generate negative numbers? Or does this function provides only number >=0? There is no information in documentation of GML.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
not_loqan
  • 91
  • 1
  • 1
  • 9

1 Answers1

2

A few examples:

a = -1 * irandom(10);

a = -irandom(10);

a = irandom(20) - 10;

a = irandom_range(-10, 10);
Dmi7ry
  • 1,777
  • 1
  • 13
  • 25