[SOLVED] Random number excludes top number

  • Автор темы Автор темы zon3d
  • Дата начала Дата начала

zon3d

Client
Регистрация
22.03.2012
Сообщения
29
Реакции
1
Баллы
3
In ZP4, I have discovered after lots of testing that if you use the Random block, specify the from and to values, you would expect it would randomly selected any of the values between the from and to values (and including the from and to values themselves), but it doesn't.

It does not ever randomly select the to number (but the from number it will select).

For example, if I put the from number as 1 and the to number as 3. It will always just output the numbers 1 or 2, never the number 3.
 
It was always that way :)
If you need 1-10 set 1-11
 
Yes I know it was that way in ZP3, but at least in that version it said in the macros builder that the last value would be excluded.

The label in ZP4 for the randomise block needs to be changed stating that the to value will never be generated.
 
It's not a bug ;)

The main idea behind it that first line in files/tables/lists also number of matches of elements starts with 0.
So.. if you have 5 lines/elements, range 0-5 (or from the start to 5) will give you exact and correct 5 results.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)