Hi All,
Is there a random function in EFS (Don't ask ;-)?
Garth
Is there a random function in EFS (Don't ask ;-)?
Garth
var barcount = 0;var ntime;
// The Central Randomizer 1.3 (C) 1997 by Paul Houle ([email protected])
// See: [url]http://www.msc.cornell.edu/~houle/javascript/randomizer.html[/url]
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
};
function rand(number) {
return Math.ceil(rnd()*number);
};
// end central randomizer. -->
function preMain(){
}
function main(){
//put stuff u want implemented every tick in here
//
if (getBarState() == BARSTATE_ALLBARS) {//true once during initial load and subsequent reload
barcount = 0;
}
if (getCurrentBarIndex() < -50 )return;
if (getBarState() == BARSTATE_NEWBAR) {
barcount ++;
trace(" ");
var a = rand(105);
trace("barcount = "+barcount+" random number = "+a);
trace("Math.random() method = "+Math.random());
}
if (getCurrentBarIndex() == -1 ){
}
//put stuff u want implemented every tick in here
}
//########### trace section required to be copied complete ##############
var tracedata = new Array();
//var traceon = true;// previous tracefile is overwritten if this is true
var traceon = false;// previous tracefile is added to if this is false
var tracefile = new File("random variable methods Trace.txt");
function trace(data1){//routine that saves the data
debugPrintln(data1);
if (traceon){//first use is true, overwrites previous trace file
traceon = false;
tracefile.open("wt+");tracefile.close();//opens and overwrites previous file
}
tracefile.open("at+");
tracefile.writeln(data1);
tracefile.close();
}//}
//sample format to save data to file
//trace("69:btest = "+btest);
//########## section required to be copied complete ################
Comment