forget how to create random variable
#1

I forgot how to create random variable

its look like this?
Код:
new randomz = random(100 - 10);
The code i want is random from 10 to 100
Reply
#2

#define RandomEx(%0,%1) (random((%1) - (%0)) + (%0))'

RandomEx(10, 100);
Reply
#3

Explain pls
Reply
#4

Wrong topic.
Reply
#5

Quote:
Originally Posted by Tee
Посмотреть сообщение
Wrong topic.
pardon me
then where i can post this?
Reply
#6

Quote:
Originally Posted by Tee
Посмотреть сообщение
Wrong topic.
It is the right topic.

OnTopic.

spedico used marcros to do a variable fast, easy and usefull.


pawn Код:
#define RandomEx(%0,%1) floatround(random((%1) - (%0)) + (%0))
That's more accurate.щ

Example:
pawn Код:
#define RandomEx(%0,%1) floatround(random((%1) - (%0)) + (%0))
    new result = RandomEx(10,100);
    printf(" result is %d ", result);
Reply
#7

Quote:
Originally Posted by leingod
Посмотреть сообщение
pardon me
then where i can post this?
Quote:
Originally Posted by TheArcher
Посмотреть сообщение
It is the right topic.

OnTopic.

spedico used marcros to do a variable fast, easy and usefull.


pawn Код:
#define RandomEx(%0,%1) floatround(random((%1) - (%0)) + (%0))
That's more accurate.щ

Example:
pawn Код:
#define RandomEx(%0,%1) floatround(random((%1) - (%0)) + (%0))
    new result = RandomEx(10,100);
    printf(" result is %d ", result);
I didn't say wrong board, I said wrong topic. I meant I posted a reply in the wrong topic...
Reply
#8

I prefer you to watch this:
[ame]http://www.youtube.com/watch?v=jS7u6r94IFw[/ame]
I learned it there...
Reply
#9

@ObelesMarc

It's more faster using macros than stocks. That makes it more faster.
But stocks can return instead.
Reply
#10

Removed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)