 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
|
 |
|
 |
05-18-2009, 07:32 PM
|
#1 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
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:
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:
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.
|
|
|
05-18-2009, 07:57 PM
|
#2 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
awesome!! and for ultimate immortality....
PHP Code:
class allworknoplay {
$aRange = range(1, 100);
}
|
|
|
|
05-18-2009, 08:04 PM
|
#3 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
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.
|
|
|
05-18-2009, 08:07 PM
|
#4 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
how come your code colors look different than my code colors?
|
|
|
|
05-18-2009, 08:10 PM
|
#5 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
[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.
|
|
|
05-18-2009, 08:17 PM
|
#6 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Wildhoney
[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); }}
|
|
|
|
|
The Following User Says Thank You to allworknoplay For This Useful Post:
|
|
05-18-2009, 09:11 PM
|
#7 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
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. :)
|
|
|
|
05-18-2009, 09:13 PM
|
#8 (permalink)
|
|
The Acquainted
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
|
Where to go with that?! We have an array of 1 to 100 and two inputs. Ooooo, what to do - let me think.....
|
|
|
05-18-2009, 09:33 PM
|
#9 (permalink)
|
|
The Contributor
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
|
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
|
|
|
|
05-18-2009, 09:46 PM
|
#10 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
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. 
|
|
|
|
05-18-2009, 10:08 PM
|
#11 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
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.
|
|
|
05-18-2009, 10:11 PM
|
#12 (permalink)
|
|
The Addict
Join Date: Jun 2008
Posts: 335
Thanks: 2
|
php Code:
<?phpclass 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
|
|
|
|
05-18-2009, 10:17 PM
|
#13 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
|
|
|
|
05-18-2009, 10:20 PM
|
#14 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
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.
|
|
|
05-18-2009, 10:27 PM
|
#15 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
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);
}
}
|
|
|
|
05-18-2009, 10:33 PM
|
#16 (permalink)
|
|
The Addict
Join Date: Jun 2008
Posts: 335
Thanks: 2
|
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(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); } }
|
|
|
|
05-18-2009, 11:08 PM
|
#17 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Enfernikus
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(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);
}
}
|
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(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);
}
public function play($song) {
}
}
|
|
|
|
05-19-2009, 07:56 AM
|
#18 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
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(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);
}
public function play($song) {
$getSong="/path/to/mp3/folder/";
}
}
|
|
|
|
05-19-2009, 12:38 PM
|
#19 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: the Netherlands
Posts: 281
Thanks: 2
|
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(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); }
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? =)
|
|
|
05-19-2009, 12:56 PM
|
#20 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
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.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|