Question about timers
#8

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
i can simply tell with example
random(2) gives two possible outputs 0 and 1 that means random(x) gives 0 to x-1 numbers
so to find range of random the programm should be like this
random(upperlimit-lowerlimit+1)+lowerlmit
for eg in this case for finding the random in range 20 to 60 seconds
it should be like this
random(60000-20000+1)+20000
or
random(40000+1)+20000
random(40000) will only give values up to 39 seconds and that plus 20 gives 59(maximum possible) not 60
so to get 60 we adds 1 to it
random(40001)+20000 give MAX-60000 or 60 seconds and MIN-200000 or 20 seconds
Thanks, I understood perfectly
Reply


Messages In This Thread
Question about timers - by MayaEU - 08.07.2016, 15:00
Re: Question about timers - by SyS - 08.07.2016, 15:03
Re: Question about timers - by diego200052 - 08.07.2016, 15:04
Re: Question about timers - by MayaEU - 08.07.2016, 15:05
Re: Question about timers - by SyS - 08.07.2016, 15:08
Re: Question about timers - by diego200052 - 08.07.2016, 15:10
Re: Question about timers - by SyS - 08.07.2016, 15:23
Re: Question about timers - by diego200052 - 08.07.2016, 15:28
Re: Question about timers - by SickAttack - 08.07.2016, 15:35

Forum Jump:


Users browsing this thread: 3 Guest(s)