Y
Y
YakovDublin2020-04-18 09:14:05
API
YakovDublin, 2020-04-18 09:14:05

How to get random number in vk execute?

How to get random number in vk execute?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Christina, 2020-04-20
@YakovDublin

There is one secret technique:

var min = 100, max = 1000;
return max-API.apps.getRandomInt({max:max-min+1});

S
Sergey Sokolov, 2020-04-18
@sergiks

There is no pseudo-random generator in VC methods.
You can generate several random ones from the server in advance (?) and save them in Storage . From the execute method, it is already easy to read random and use it to get a specific id.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question