Just a random number generator that attempts to bypass the steady-state of a computer. It can be used for other scripts if you follow the directions in this script.
[update] Fixed a small error that I should have caught earlier
/* This script produces random numbers of a length that the user sets. The final number can be used in other scripts by changing
the var %rand to set %rand
*/
alias rand {
var %leng = $$?="Number of places?"
:check
var %rand = $rand(0,9)
var %rand = $str(%rand,4)
var %rand = $calc($int($asin($rand(1,%rand))))
var %rand = $calc((%rand * %leng) * (%rand * $rand(1,9)))
if ($len(%rand) < %leng) {
goto check
}
var %rand = $right(%rand,%leng)
; change var to set %rand when used for other scripts
.echo The Random Number is %rand
}
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....
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.
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??