Welcome to Gaia! ::


HHEEELLLPPP!!!
Randomizers?
Wesker99
Randomizers?

Yeah.... I need the code.
Yeah, I don't know what you mean by randomizer..
any particular language?
If you means random number generation.. Google it.. 3nodding
Just make the seed for a random number generator equal to a random number times your birthday (expressed in months from 1900), divided by a random number, rounded up. Either that, or figure out how to convert images into a single number for a seed and set up a video camera to monitor something that changes in a chaotic fashion (like trees, cats, or lava lamps).
If you mean a random image script for avatars etc, I use this (it's php and will need a php enabled server)

<?php


$file = getRandomImage('./')

header('Content-Type: image/.gif')
header('Pragma: no-cache')
header('Expires: 0')
readfile($file)

function getRandomImage($dir,$type='random')
{
global $errors;

if (is_dir($dir)) {

$fd = opendir($dir)
$images = array()

while (($part = @readdir($fd)) == true) {

clearstatcache()

if ( eregi("(gif|jpg|png|jpeg)$",$part) ) {
$images[] = $part;
}
}

// adding this in case you want to return the image array
if ($type == 'all') { return $images; }

// Be sure to call srand() once per script
srand ((double) microtime() * 1000000)
$key = rand (0,sizeof($images)-1)

return $dir . $images[$key]

} else {
$errors[] = $dir.' is not a directory';
return false;
}
}

?>

Quick Reply

Submit
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum