Random generates only one number

jcknick

Client
Регистрация
10.05.2013
Сообщения
154
Благодарностей
9
Баллы
18
Hi, I've just updated ZP to the latest version and came across a strange problem. I need Random generator to either give me 1 or 2. And it keeps giving me 1 - 100% of the time.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 182
Баллы
113
Generate random number from 1-3 will give you 1 OR 2

Nothing new, this is like that from code was born :D
 

jcknick

Client
Регистрация
10.05.2013
Сообщения
154
Благодарностей
9
Баллы
18
Oh... is this some universal programming principle? Or is it only PM related? :-) so if i set 1 to 100, i will never get a 100 and 99 will be the max number?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 182
Баллы
113
Oh... is this some universal programming principle? Or is it only PM related? :-) so if i set 1 to 100, i will never get a 100 and 99 will be the max number?
Yes as i said this is nothing new and was there from code was born :-)
You generate numbers excluding last number you show... Not only in PM this is like that in whole c#
 

jcknick

Client
Регистрация
10.05.2013
Сообщения
154
Благодарностей
9
Баллы
18
Another day, another how-to... Thanks ;-)
 

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