TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   The Lounge (http://www.talkphp.com/lounge/)
-   -   Game: Let's Develop Something Crazy! (http://www.talkphp.com/lounge/4356-game-lets-develop-something-crazy.html)

Wildhoney 05-18-2009 07:32 PM

Game: Let's Develop Something Crazy!
 
Okay. Now, I have no idea how this is going to turn out, but I am all for giving it a go in the interest of meaningless experiments :-) !
  • What we do: Each of us adds a single line of code (One line, no more than one).
  • Objective: At the start the code will be absolutely useless and not do much of anything, but over time we'll create some code that will do something. I'm not sure how useful it will be, but it will do something.
    Philosophy: I am thinking that after a while, each one of us will have a different idea on where the script is going. As it evolves, hopefully we'll be able to take one direction. Call it a consensus, if you will.

To summarise, you can only add one line of code at a time. And you must wait until somebody else adds another line before you post again.

You cannot edit another person's line of code, so ensure it works before you post.

You may place a line anywhere in the code. If you're creating a function or a class, please add both parenthesis. Adding this is okay, and is classed as one go:

php Code:
class Bleh
{

}

Please post only PHP code.

We'll see what mess we can make. It will be interesting to see if we can spot the direction the code is heading, and build upon it. Somebody may add code that goes against what everybody else is doing, in which case it is up to people to correct it. In the end, a leading majority should have an idea as we add more code.

You cannot discuss what people should add next, nor the direction it SHOULD head. Leave it up to people to analyse the code and see for themselves where it is heading. It will be an interesting experiment in spotting patterns, writing code to work with other peoples' code, and social cohesion :-) ! I suppose.

This is not an experiment to see who writes the best code. ANYBODY can post, but don't be silly and add a meaningless loop. Code to the best of your ability, and don't add anything you wouldn't place in your own functional scripts.

Any questions, please do ask before posting. I will start us off with the first line of code:

php Code:
$aRange = range(1, 100);

Note: Add whatever you like as long as it's PHP. Classes, functions, inheritance, loops, conditionals, etcetera. All is fine!

To play: Take the last person's code (such as my range) and add a line of code to it (anywhere).

allworknoplay 05-18-2009 07:57 PM

awesome!! and for ultimate immortality....

PHP Code:

 class allworknoplay {

$aRange range(1100);







Wildhoney 05-18-2009 08:04 PM

Tart! :-( Well I've at least got to make the code work.

php Code:
class allworknoplay
{
    public function __construct()
    {
        $aRange = range(1, 100);
    }
}

allworknoplay 05-18-2009 08:07 PM

how come your code colors look different than my code colors?

Wildhoney 05-18-2009 08:10 PM

[highlight=php] as opposed to [php].

allworknoplay 05-18-2009 08:17 PM

Quote:

Originally Posted by Wildhoney (Post 24307)
[highlight=php] as opposed to [php].

I see....well back to the game....let's add some arguments
to our construct, hope this doesn't break the rules...

php Code:
class allworknoplay
{
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
    }
}

Salathe 05-18-2009 09:11 PM

Code:

class allworknoplay
{
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
        $sNote  = pack('H*', '48656C6C6F2054616C6B50485021');
    }
}

Another line which may start off being useless, but who knows how it will be used. :)

Hightower 05-18-2009 09:13 PM

Where to go with that?! We have an array of 1 to 100 and two inputs. Ooooo, what to do - let me think.....

ioan1k 05-18-2009 09:33 PM

php Code:
class allworknoplay
{
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
$sNote  = pack('H*', '48656C6C6F2054616C6B50485021');
$aString = sprintf('%s Remember this day %s', $sNote, date('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));

    }
}

Add some text and give the array and binary transform some reason, with some complete randomness for a date

Salathe 05-18-2009 09:46 PM

Code:

class allworknoplay
{
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
        // Obfuscated string "Hello TalkPHP!"
        $sNote  = pack('H*', '48656C6C6F2054616C6B50485021');
        $aString = sprintf('%s Remember this day %s', $sNote, date('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
    }
}


Added comment since there's no point having mystery code floating around. ^^

Wildhoney 05-18-2009 10:08 PM

php Code:
class allworknoplay
{
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
        // Obfuscated string "Hello TalkPHP!"
        $sNote  = pack('H*', '48656C6C6F2054616C6B50485021');
        $aString = sprintf('%s Remember this day %s', $sNote, date('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is', $aString, $aMatches);
    }
}

Enfernikus 05-18-2009 10:11 PM

php Code:
<?php

class allworknoplay
{
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
        // Obfuscated string "Hello TalkPHP!"
        $sNote  = pack('H*', '48656C6C6F2054616C6B50485021');
        $aString = sprintf('%s Remember this day %s', $sNote, date('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        $szPaddedString = str_pad( $aString, (($sqr = ceil(sqrt( strlen($aString)))) * $sqr), '|');
        preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is', $aString, $aMatches);
    }
}

allworknoplay 05-18-2009 10:17 PM

wow, this is going to be one bloated construct.

:-P:-P:-P

Wildhoney 05-18-2009 10:20 PM

Yep! :-)

php Code:
class allworknoplay
{
    private $m_szValue;
   
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
        // Obfuscated string "Hello TalkPHP!"
        $sNote  = pack('H*', '48656C6C6F2054616C6B50485021');
        $aString = sprintf('%s Remember this day %s', $sNote, date('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        $szPaddedString = str_pad( $aString, (($sqr = ceil(sqrt( strlen($aString)))) * $sqr), '|');
        preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is', $aString, $aMatches);
    }
}

Salathe 05-18-2009 10:27 PM

Code:


__halt_compiler(); // Stop! Hammertime!

class allworknoplay
{
    private $m_szValue;
 
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
        // Obfuscated string "Hello TalkPHP!"
        $sNote  = pack('H*', '48656C6C6F2054616C6B50485021');
        $aString = sprintf('%s Remember this day %s', $sNote, date('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        $szPaddedString = str_pad( $aString, (($sqr = ceil(sqrt( strlen($aString)))) * $sqr), '|');
        preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is', $aString, $aMatches);
    }
}


Enfernikus 05-18-2009 10:33 PM

PHP Code:

<?php

eval( str_replace'__halt_compler();''',file_get_contents(__FILE__) ) );

__halt_compiler(); 
// Stop! Hammertime!

class allworknoplay
{
    private 
$m_szValue;
   
    public function 
__construct($x,$y)
    {
        
$aRange range(1100);
        
// Obfuscated string "Hello TalkPHP!"
        
$sNote  pack('H*''48656C6C6F2054616C6B50485021');
        
$aString sprintf('%s Remember this day %s'$sNotedate('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        
$szPaddedString str_pad$aString, (($sqr ceil(sqrtstrlen($aString)))) * $sqr), '|');
        
preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is'$aString$aMatches);
    }
}


allworknoplay 05-18-2009 11:08 PM

Quote:

Originally Posted by Enfernikus (Post 24337)
PHP Code:

<?php

eval( str_replace'__halt_compler();''',file_get_contents(__FILE__) ) );

__halt_compiler(); 
// Stop! Hammertime!

class allworknoplay
{
    private 
$m_szValue;
   
    public function 
__construct($x,$y)
    {
        
$aRange range(1100);
        
// Obfuscated string "Hello TalkPHP!"
        
$sNote  pack('H*''48656C6C6F2054616C6B50485021');
        
$aString sprintf('%s Remember this day %s'$sNotedate('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        
$szPaddedString str_pad$aString, (($sqr ceil(sqrtstrlen($aString)))) * $sqr), '|');
        
preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is'$aString$aMatches);
    }
}




PHP Code:

<?php

eval( str_replace'__halt_compler();''',file_get_contents(__FILE__) ) );

__halt_compiler(); 
// Stop! Hammertime!

class allworknoplay
{
    private 
$m_szValue;
   
    public function 
__construct($x,$y)
    {
        
$aRange range(1100);
        
// Obfuscated string "Hello TalkPHP!"
        
$sNote  pack('H*''48656C6C6F2054616C6B50485021');
        
$aString sprintf('%s Remember this day %s'$sNotedate('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        
$szPaddedString str_pad$aString, (($sqr ceil(sqrtstrlen($aString)))) * $sqr), '|');
        
preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is'$aString$aMatches);
    }


    public function 
play($song) {

   }

}


codefreek 05-19-2009 07:56 AM

PHP Code:


<?php

eval( str_replace'__halt_compler();''',file_get_contents(__FILE__) ) );

__halt_compiler(); 
// Stop! Hammertime!

class allworknoplay
{
    private 
$m_szValue;
   
    public function 
__construct($x,$y)
    {
        
$aRange range(1100);
        
// Obfuscated string "Hello TalkPHP!"
        
$sNote  pack('H*''48656C6C6F2054616C6B50485021');
        
$aString sprintf('%s Remember this day %s'$sNotedate('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        
$szPaddedString str_pad$aString, (($sqr ceil(sqrtstrlen($aString)))) * $sqr), '|');
        
preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is'$aString$aMatches);
    }


    public function 
play($song) {
    
$getSong="/path/to/mp3/folder/";
   }

}


Jim 05-19-2009 12:38 PM

PHP Code:

<?php

eval( str_replace'__halt_compler();''',file_get_contents(__FILE__) ) );

__halt_compiler(); 
// Stop! Hammertime!

class allworknoplay
{
    private 
$m_szValue;
   
    public function 
__construct($x,$y)
    {
        
$aRange range(1100);
        
// Obfuscated string "Hello TalkPHP!"
        
$sNote  pack('H*''48656C6C6F2054616C6B50485021');
        
$aString sprintf('%s Remember this day %s'$sNotedate('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        
$szPaddedString str_pad$aString, (($sqr ceil(sqrtstrlen($aString)))) * $sqr), '|');
        
preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is'$aString$aMatches);
    }


    public function 
play($song) {    
    
$getSong="/path/to/mp3/folder/";
    
$allowedStyles = array('drum & bass''jungle''uk hardcore''minimal''electro');
   }

}


Wildhoney 05-19-2009 12:56 PM

I've decided to take a proactive approach and removed the halt compiler :-) It's for the best!

php Code:
class allworknoplay
{
    private $m_szValue;
   
    public function __construct($x,$y)
    {
        $aRange = range(1, 100);
        // Obfuscated string "Hello TalkPHP!"
        $sNote  = pack('H*', '48656C6C6F2054616C6B50485021');
        $aString = sprintf('%s Remember this day %s', $sNote, date('m/d/y h:ia', (array_rand($aRange) * 3600) + time()));
        $szPaddedString = str_pad( $aString, (($sqr = ceil(sqrt( strlen($aString)))) * $sqr), '|');
        preg_match_all('~^(?P<welcome>.+?!).+?(?P<date>\d+?/\d+?/\d+)\s*(?P<time>.+)$~is', $aString, $aMatches);
       
        $this->m_szValue = sprintf('%s.%s', str_replace('Hello TalkPHP!', $sNote, $x), $y);
    }


    public function play($song) {   
    $getSong="/path/to/mp3/folder/";
    $allowedStyles = array('drum & bass', 'jungle', 'uk hardcore', 'minimal', 'electro');
   }

}


All times are GMT. The time now is 10:52 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0