Simple random Number
mIRC Code
+ 0 likes
Please Register to submit score.
| Average Score | 3.7 (of 3 scores) |
| Date Added | Apr 11, 2006 |
| Last Updated | Apr 12, 2006 |
| Tags | number random |
Introduction
[update] Fixed a small error that I should have caught earlier
mIRC Snippet:
Simple random Number
Posted on Apr 11, 2006 1:40 am
Posted on Apr 11, 2006 1:40 am
alias crand {
if $1 !isnum { return $false }
var %i = 1,%b = $1,%c = 9, %r
while %i <= %b {
set %r $addtok(%r,$r(%i,%c),0)
inc %i
}
echo -a %r
}
also does the job :> syntax: /crand <number> I.e /crand 5 = 74557
if $1 !isnum { return $false }
var %i = 1,%b = $1,%c = 9, %r
while %i <= %b {
set %r $addtok(%r,$r(%i,%c),0)
inc %i
}
echo -a %r
}
also does the job :> syntax: /crand <number> I.e /crand 5 = 74557
mIRC Snippet:
Simple random Number
Posted on Apr 13, 2006 12:04 am
Posted on Apr 13, 2006 12:04 am
But, it does not take into account the fact that your computer computes $rand based on its current state. With the speed of calculations that it can do, $rand is not truly random.
(7+4+5+5+7)/5=5.6
(7+4+5+5+7)/5=5.6
mIRC Snippet:
Simple random Number
Posted on Apr 19, 2006 6:28 am
Posted on Apr 19, 2006 6:28 am
well of course true random numbers dont exist ;P
mIRC Snippet:
Simple random Number
Posted on Apr 22, 2006 12:08 am
Posted on Apr 22, 2006 12:08 am
Pretty useful in my opinion. I think this snippet is under rated.
mIRC Snippet:
Simple random Number
Posted on Apr 22, 2006 10:20 am
Posted on Apr 22, 2006 10:20 am
pretty useful but here's the thing, what exactally does the score represent? the use of the script or the sleakness in design. that's one thing that's always confused me about this place. there's alot of damn good snippets here but recieved low scores because of various reasons.
this snippet is useful but could be coded much better. so what should the score be??
this snippet is useful but could be coded much better. so what should the score be??
mIRC Snippet:
Simple random Number
Posted on Apr 22, 2006 7:22 pm
Posted on Apr 22, 2006 7:22 pm
I suppose you decide that for yourself, based on the overall, all-inclusive quality of the script.
I personally think it should be scored based solely on function. If it works well and is practical, it gets a good score. If the coding could be neater, that's something to talk about in a comment, but I don't think it should affect the snippet's score.
The only exception is if the code is really ugly and the snippet is made to be modified for a person's own purposes. Then it SHOULD be judged on neatness and efficiency of the code.
I personally think it should be scored based solely on function. If it works well and is practical, it gets a good score. If the coding could be neater, that's something to talk about in a comment, but I don't think it should affect the snippet's score.
The only exception is if the code is really ugly and the snippet is made to be modified for a person's own purposes. Then it SHOULD be judged on neatness and efficiency of the code.
mIRC Snippet:
Simple random Number
Posted on Apr 24, 2006 11:41 am
Posted on Apr 24, 2006 11:41 am
I agree that the scoring system needs a total overhaul. I think for some just the definitions of the numbers is the problem, as they are quite vague.
As for the script, yeah it could be a bit neater, but this one was done on the fly, and I have never been one to really like using multistep variable definitions because it is easier to get lost that way.
Surely I could have done something like:
%a = $rand(0,9), %b = $str(%a,4), %c = $calc($int($asin($rand(1,%b))))
and so on and so on....
As for the script, yeah it could be a bit neater, but this one was done on the fly, and I have never been one to really like using multistep variable definitions because it is easier to get lost that way.
Surely I could have done something like:
%a = $rand(0,9), %b = $str(%a,4), %c = $calc($int($asin($rand(1,%b))))
and so on and so on....




