Numbers + Random


so.... have seen quite few programs on here wide variety of things in last month or have been playing arduino , scavenging information can kewl projects may interesting in putting together.

one thing can't see difference in people number add method instead of typing number.

for example, whats difference in...

random (255);

or

random ((120) + 135);

does matter? have seen quite few people addition method seems easier put want in there , continue on......i dunno maybe i'm thick.

:-/ i'm confused.....

when random function invoked, result same value being passed in.

the reason not adding numbers in advance comes form separate numbers having meaning author, resulting added number looses significance.

for example, if i'm writing code simulate roll of dice, i'd inclined write random(6 + 6); write random(12); because it's more obvious (to me) 6 has significance whereas 12 requires moment's thought.


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Numbers + Random


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums