TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-18-2009, 07:32 PM   #1 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Bug 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).
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 05-18-2009, 07:57 PM   #2 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

awesome!! and for ultimate immortality....

PHP Code:
 class allworknoplay {

$aRange range(1100);





allworknoplay is offline  
Reply With Quote
Old 05-18-2009, 08:04 PM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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

php Code:
class allworknoplay
{
    public function __construct()
    {
        $aRange = range(1, 100);
    }
}
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 05-18-2009, 08:07 PM   #4 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

how come your code colors look different than my code colors?
allworknoplay is offline  
Reply With Quote
Old 05-18-2009, 08:10 PM   #5 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

[highlight=php] as opposed to [php].
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 05-18-2009, 08:17 PM   #6 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
[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);
    }
}
allworknoplay is offline  
Reply With Quote
The Following User Says Thank You to allworknoplay For This Useful Post:
Wildhoney (05-18-2009)
Old 05-18-2009, 09:11 PM   #7 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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. :)
Salathe is offline  
Reply With Quote
Old 05-18-2009, 09:13 PM   #8 (permalink)
The Acquainted
 
Hightower's Avatar
 
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
Hightower is on a distinguished road
Default

Where to go with that?! We have an array of 1 to 100 and two inputs. Ooooo, what to do - let me think.....
__________________
Hightower's Softpolio
Send a message via MSN to Hightower
Hightower is offline  
Reply With Quote
Old 05-18-2009, 09:33 PM   #9 (permalink)
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default

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
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote
Old 05-18-2009, 09:46 PM   #10 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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.
Salathe is offline  
Reply With Quote
Old 05-18-2009, 10:08 PM   #11 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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);
    }
}
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 05-18-2009, 10:11 PM   #12 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

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);
    }
}

Last edited by Wildhoney : 05-18-2009 at 10:19 PM. Reason: Putting my code into yours
Enfernikus is offline  
Reply With Quote
Old 05-18-2009, 10:17 PM   #13 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

wow, this is going to be one bloated construct.

allworknoplay is offline  
Reply With Quote
Old 05-18-2009, 10:20 PM   #14 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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);
    }
}
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 05-18-2009, 10:27 PM   #15 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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);
    }
}
Salathe is offline  
Reply With Quote
Old 05-18-2009, 10:33 PM   #16 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

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);
    }
}
Enfernikus is offline  
Reply With Quote
Old 05-18-2009, 11:08 PM   #17 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Enfernikus View Post
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) {

   }

}
allworknoplay is offline  
Reply With Quote
Old 05-19-2009, 07:56 AM   #18 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

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/";
   }

}
codefreek is offline  
Reply With Quote
Old 05-19-2009, 12:38 PM   #19 (permalink)
Jim
The Addict
 
Jim's Avatar
 
Join Date: Nov 2007
Location: the Netherlands
Posts: 281
Thanks: 2
Jim is on a distinguished road
Default

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');
   }

}
__________________
Nunchaku! Who doesn't like martial arts? =)
Send a message via MSN to Jim Send a message via Skype™ to Jim
Jim is offline  
Reply With Quote
Old 05-19-2009, 12:56 PM   #20 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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');
   }

}
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking Programer | Web Based:Political Strategy game Badmonur Advanced PHP Programming 1 08-25-2008 04:41 AM
I made a game! Village Idiot The Lounge 2 04-15-2008 04:46 PM
pole: what do you use to develop php with sarmenhb General 40 01-26-2008 09:33 PM
What version of PHP do you develop for? Alan @ CIT General 13 01-19-2008 10:49 PM
Lost Crazy - Watch Lost Online Craddock Show Off 4 09-17-2007 05:50 PM


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

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design