Author Topic: [Game] The first thing that comes to your mind  (Read 883668 times)

Offline froody1911

  • Member
  • Posts: 7213
  • Confucius say man's last will is dead giveaway.
    • froody1911
Re: [Game] The first thing that comes to your mind
« Reply #29180 on: December 30, 2012, 03:12:05 AM »
Speaking of ava/sigs, I still can't pull off that timed rotation thing.  It's frustrating.
I actually had to make a PHP script and host it on a free webspace to pull that off when I was rotating 2 matched sets last year. It was a pretty challenging problem, but at least I learned PHP in the process. I'd put your sets on it but I can't find the script :'(

MAL | Your mother was a father and your hamster smelt of elderberries | last.fm

Online Tiffanys

  • Member
  • Posts: 7759
  • real female girl ojō-sama
Re: [Game] The first thing that comes to your mind
« Reply #29181 on: December 30, 2012, 03:54:08 AM »
Name your folder something like "picture.gif" and use this index.php:

<?php
/*
By Matt Mullenweg > http://photomatt.net
Inspired by Dan Benjamin > http://hiveware.com/imagerotator.php
Latest version always at:
http://photomatt.net/scripts/randomimage
*/

// Make this the relative path to the images, like "../img" or "random/images/".
// If the images are in the same directory, leave it blank.
$folder '';

// Space seperated list of extensions, you probably won't have to change this.
$exts 'jpg jpeg png gif';

$files = array(); $i = -1// Initialize some variables
if ('' == $folder$folder './';
$handle opendir($folder);
$exts explode(' '$exts);
while (
false !== ($file readdir($handle))) {
foreach(
$exts as $ext) { // for each extension check the extension
if (preg_match('/\.'.$ext.'$/i'$file$test)) { // faster than ereg, case insensitive
$files[] = $file// it's good
++$i;
}
}
}
closedir($handle); // We're not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
$rand mt_rand(0$i); // $i was incremented as we went along

header('Location: '.$folder.$files[$rand]); // Voila!
?>

Offline froody1911

  • Member
  • Posts: 7213
  • Confucius say man's last will is dead giveaway.
    • froody1911
Re: [Game] The first thing that comes to your mind
« Reply #29182 on: December 30, 2012, 04:52:28 AM »
Interesting approach using random variables. I tried that but it occasionally showed the same set twice in a row.
My script used a text file to store which of the sets it had displayed to the previous client requesting a webpage containing my set. The next request would be sent one of the sets other than the previous one. The pitfall was that if, by some tiny chance, the script received two requests at the same instant, it would probably fuck up and the text file would require manual fixing.

MAL | Your mother was a father and your hamster smelt of elderberries | last.fm

Offline Belmakar

  • Member
  • Posts: 426
  • Yukkuri shiteitte ne!!
Re: [Game] The first thing that comes to your mind
« Reply #29183 on: December 30, 2012, 08:29:44 AM »
wouldn't it have been easier to just use a database for metadata storage?

Offline anoligarh

  • Member
  • Posts: 308
  • All we are is dust in the wind.
Re: [Game] The first thing that comes to your mind
« Reply #29184 on: December 30, 2012, 09:17:08 AM »
Is it hard to learn programming? I'd like to start with a useful language but i have no idea which, and apparently they are all difficult.

Online Tiffanys

  • Member
  • Posts: 7759
  • real female girl ojō-sama
Re: [Game] The first thing that comes to your mind
« Reply #29185 on: December 30, 2012, 09:37:46 AM »

Offline Belmakar

  • Member
  • Posts: 426
  • Yukkuri shiteitte ne!!
Re: [Game] The first thing that comes to your mind
« Reply #29186 on: December 30, 2012, 09:53:24 AM »
^LOL

Is it hard to learn programming? I'd like to start with a useful language but i have no idea which, and apparently they are all difficult.
The start will always be difficult, because learning something from scratch is never easy. It'll become easier over time though, when you have (at least partially) understood the basic principles and how to achieve your goals.

The easiest languages to start with (IMO) are scripting languages like PHP or Javascript, as they are far more forgiving than something low level like C and not as complicated as object oriented languages like C# or Java, even though they are not necessarily easy to master (especially Javascript).
« Last Edit: December 30, 2012, 09:58:47 AM by Belmakar »

Offline Sepukku

  • Member
  • Posts: 732
  • Slap 'n Tickle
Re: [Game] The first thing that comes to your mind
« Reply #29187 on: December 30, 2012, 10:03:48 AM »
Automatic updates off.
The human body is merely a channel for excrements to pass.

Offline N2O

  • Member
  • Posts: 266
  • Gnisworb tsuj M'i. Em dnim t'nod...
Re: [Game] The first thing that comes to your mind
« Reply #29188 on: December 30, 2012, 10:20:11 AM »


Sigh.  I'll quit this scripting language for now, and stick with just one set.

Offline undetz

  • Member
  • Posts: 3430
Re: [Game] The first thing that comes to your mind
« Reply #29189 on: December 30, 2012, 10:34:54 AM »
Nooo! Don't give up!

Offline Goldfrapp

  • Member
  • Posts: 854
  • Don't look back, you'r not going that way.
Re: [Game] The first thing that comes to your mind
« Reply #29190 on: December 30, 2012, 11:09:02 AM »
What which yields is not always weak.
The problem with the world is that the intelligent  people are full of doubts, while the stupid ones are full of confidence.

Offline undetz

  • Member
  • Posts: 3430
Re: [Game] The first thing that comes to your mind
« Reply #29191 on: December 30, 2012, 11:10:54 AM »
We're talking about scripting languages here, not toothbrushes.

Online Tiffanys

  • Member
  • Posts: 7759
  • real female girl ojō-sama
Re: [Game] The first thing that comes to your mind
« Reply #29192 on: December 30, 2012, 11:29:59 AM »


We are now.  ;D

Offline TiYlER

  • Member
  • Posts: 5186
  • 絶対大丈夫だよ!
    • My recently watched anime
Re: [Game] The first thing that comes to your mind
« Reply #29193 on: December 30, 2012, 02:14:25 PM »

Shit I'm Watching | They say time flies, but you keep breaking its wings.

Offline bunalz

  • Member
  • Posts: 194
  • Loneliness is a deadly poison which robs the soul.
    • Tracker Profile *REMAKE*
Re: [Game] The first thing that comes to your mind
« Reply #29194 on: December 30, 2012, 02:20:43 PM »

Online Tiffanys

  • Member
  • Posts: 7759
  • real female girl ojō-sama
Re: [Game] The first thing that comes to your mind
« Reply #29195 on: December 30, 2012, 02:33:37 PM »
I can explain that actually......

Offline ye0manb0wman

  • Member
  • Posts: 33
Re: [Game] The first thing that comes to your mind
« Reply #29196 on: December 30, 2012, 02:51:58 PM »

Explained.

Offline BowlofRice

  • Member
  • Posts: 150
  • Call me Gohan, Shimapan...or BowlofRiceKrispies!
Re: [Game] The first thing that comes to your mind
« Reply #29197 on: December 30, 2012, 03:27:00 PM »
Dat team up

Offline undetz

  • Member
  • Posts: 3430
Re: [Game] The first thing that comes to your mind
« Reply #29198 on: December 30, 2012, 04:06:53 PM »
Well, as your signature says... Eat it yourself!

Online Tiffanys

  • Member
  • Posts: 7759
  • real female girl ojō-sama
Re: [Game] The first thing that comes to your mind
« Reply #29199 on: December 30, 2012, 04:13:31 PM »