You are not logged in.
Pages: 1
Is there anyway to make a script with a legitimately random outcome? Like, random in that there are a number of possible outcomes that you set up and the one that returns is determined by chance?
If we don't change the direction we're going, we'll likely end up where we're headed.
Offline
int i = 1;
max_i = 10;
void random_gen() {
i = i+1;
if(i > max_i) i = 1;
sleep 1;
fork random_gen
}
Iritscen:
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
In truth, no, there is no random() function in BSL, Leus. There should be, but there isn't. Oni's engine randomizes some things, but there's no facility for it in BSL. Gumby's function simply loops a number from 1-10 infinitely. This can be used to simulate randomness sometimes.
Check out the Anniversary Edition Seven at ae.oni2.net!
Offline
Expect a proper random function in the next release of Daodan
Offline
lol. Miles wad language is in ur signature?
Offline
Expect a proper random function in the next release of Daodan
SSSSHHH. You will ruin the surprise.
Iritscen:
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
lol. Miles wad language is in ur signature?
English with special characters. It worked on the old forum...
Offline
To Gumby: O.o I cant wait.
To Ros: lol. What kind of special letters? The alt letters? like this> ™ ?
Last edited by Stevinlewis (10/20/09 04:10)
Offline
To Ros: lol. What kind of special letters? The alt letters? like this> ™ ?
This is getting very off-topic, but yes.
Offline
I would hypothetically make good use of that function.
If we don't change the direction we're going, we'll likely end up where we're headed.
Offline
Functions like this one are interesting and useful additions to BSL. It is nice.
Offline
Pages: 1