[PHP] Re: PHP Brain Teasers

2008-08-06 Thread tedd
At 12:51 PM -0400 8/5/08, Daniel Brown wrote: On Tue, Jun 26, 2007 at 1:44 PM, Daniel Brown [EMAIL PROTECTED] wrote: Try to use some really common phrases that all of us around the world should recognize, but feel free to get really elaborate with the code. function

[PHP] Re: PHP Brain Teasers

2008-08-05 Thread Daniel Brown
On Tue, Jun 26, 2007 at 1:44 PM, Daniel Brown [EMAIL PROTECTED] wrote: Try to use some really common phrases that all of us around the world should recognize, but feel free to get really elaborate with the code. ?php function youBetter($func) { return Schedule cleared.; } if(!date(s))

Re: [PHP] Re: PHP Brain Teasers

2008-01-04 Thread Daniel Brown
On Jul 20, 2007 1:09 PM, Daniel Brown [EMAIL PROTECTED] wrote: This isn't necessarily a brain-teaser, but it's still pretty cool. Dice (the employment site) has a new advertisement out there that says the following: What's missing from your job? ?php format = 'The %2s contains

Re: [PHP] Re: PHP Brain Teasers

2007-07-20 Thread Daniel Brown
This isn't necessarily a brain-teaser, but it's still pretty cool. Dice (the employment site) has a new advertisement out there that says the following: What's missing from your job? ?php format = 'The %2s contains %1d orders'; printf(format, num, location ? I thought it was a

Re: [PHP] Re: PHP Brain Teasers

2007-07-20 Thread tedd
At 2:09 PM -0400 7/20/07, Daniel Brown wrote: This isn't necessarily a brain-teaser, but it's still pretty cool. In similar fashion, I tell clients, you can have: a) Quality; b) Cheap; c) Quick; Pick any two. Cheers, tedd -- --- http://sperling.com http://ancientstones.com

Re: [PHP] Re: PHP Brain Teasers

2007-07-13 Thread Richard Lynch
On Thu, July 12, 2007 10:20 am, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented the chimney? ?php

Re: [PHP] Re: PHP Brain Teasers

2007-07-13 Thread Richard Lynch
On Thu, July 12, 2007 10:26 am, Robert Cummings wrote: On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean

Re: [PHP] Re: PHP Brain Teasers

2007-07-13 Thread Robert Cummings
On Fri, 2007-07-13 at 01:59 -0500, Richard Lynch wrote: On Thu, July 12, 2007 10:20 am, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you

Re: [PHP] Re: PHP Brain Teasers

2007-07-13 Thread Daniel Brown
On 7/13/07, Robert Cummings [EMAIL PROTECTED] wrote: But more importantly there's an omission of the concept of both ways ;) Ha! I was thinking exactly the same thing! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List

RE: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Jay Blanchard
[snip] Mine was trying to go for an old funk song that starts: What goes up, must come down. Spinning wheel got to go 'round Drop all the painted ponies by the riverside. [mumble] let the spinning wheel slide. Only later did I realize I broke the cardinal rule of Name That Tune and have NO IDEA

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown
On 7/12/07, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Mine was trying to go for an old funk song that starts: What goes up, must come down. Spinning wheel got to go 'round Drop all the painted ponies by the riverside. [mumble] let the spinning wheel slide. Only later did I realize I broke

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Thijs Lensselink
On Thu, 12 Jul 2007 09:56:18 -0400, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Mine was trying to go for an old funk song that starts: What goes up, must come down. Spinning wheel got to go 'round Drop all the painted ponies by the

[PHP] Re: PHP Brain Teasers

2007-07-12 Thread Colin Guthrie
Thijs Lensselink wrote: ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? That also illustrates to newbies the allowance of using an underscore as a variable. (Thank God it's almost Friday) Thank _God_ it's Friday??? Covering all

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown
On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? It was supposed to be money is the root of all evil, but the code above wouldn't work correctly anyway, as

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema
On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? It was supposed to be money is the root of all

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented the chimney? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile]

RE: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Jay Blanchard
[snip] ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? It was supposed to be money is the root of all evil, but the code above wouldn't work correctly anyway, as each time through the for() loop it'll try to get the square

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented the chimney?

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 11:27 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Stut
Robert Cummings wrote: On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown
On 7/12/07, Tijnema [EMAIL PROTECTED] wrote: You can probably remember the good old time of being a child and having holiday ;) Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info Don't rub it in, Matijn ;-P -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema
On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Tijnema [EMAIL PROTECTED] wrote: You can probably remember the good old time of being a child and having holiday ;) Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info Don't rub it in, Tijnema ;-P

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown
On 7/12/07, Tijnema [EMAIL PROTECTED] wrote: On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Tijnema [EMAIL PROTECTED] wrote: You can probably remember the good old time of being a child and having holiday ;) Tijnema -- Vote for PHP Color Coding in Gmail! -

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 17:06 +0200, Tijnema wrote: On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ =

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Jon Anderson
Daniel Brown wrote: Did you come before or after the chicken egg? Relevant to the above: $a = array('Chicken','Egg'); echo The . $a[array_rand($a)] . comes first.; I appologize if this one's already been done...I've only glanced at a few entries in this thread, entertaining though it

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: I wasn't born silly-ass, I was hatched. :) Did you come before or after the chicken egg? After the first one, but I fried it up and so earth had to wait another couple of million years for a chicken to evolve again. Ah, so then,

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema
On 7/12/07, Jon Anderson [EMAIL PROTECTED] wrote: Daniel Brown wrote: Did you come before or after the chicken egg? Relevant to the above: $a = array('Chicken','Egg'); echo The . $a[array_rand($a)] . comes first.; I appologize if this one's already been done...I've only glanced at a few

Re: [PHP] Re: PHP Brain Teasers

2007-07-11 Thread Richard Lynch
On Tue, July 3, 2007 3:51 pm, Jochem Maas wrote: $I = null; sleep(10); $I = rear(); function rear() {}; Looks like a snooze alarm to me... :-) Mine was trying to go for an old funk song that starts: What goes up, must come down. Spinning wheel got to go 'round Drop all the painted ponies by

Re: [PHP] Re: PHP Brain Teasers

2007-07-07 Thread Tijnema
On 7/7/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Isn't this a PHP list? Why is there discussion about chickens? if ($this == PHP List) { unset('chicken discussion!'); } Hmm, I'm too bad with this things :( For me, the chicken never predated the chicken egg, and the chicken egg never

Re: [PHP] Re: PHP Brain Teasers

2007-07-07 Thread tedd
At 8:26 PM -0700 7/6/07, [EMAIL PROTECTED] wrote: Isn't this a PHP list? Why is there discussion about chickens? if ($this == PHP List) { unset('chicken discussion!'); } Because obviously, we occasionally wander off topic. Your php example made your point very well and was within the

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread Jochem Maas
Daniel Brown wrote: Let's get obscure try to guess it before running the code. It actually shouldn't be difficult. I tried to figure it out - I couldn't, I ran the code and I still don't get it. oh well :-) ? class Brainteaser { function

[PHP] Re: PHP Brain Teasers

2007-07-06 Thread Colin Guthrie
Jochem Maas wrote: Daniel Brown wrote: Let's get obscure try to guess it before running the code. It actually shouldn't be difficult. I tried to figure it out - I couldn't, I ran the code and I still don't get it. oh well :-) I'm guessing it's related to Don't put all your eggs in

[PHP] Re: PHP Brain Teasers

2007-07-06 Thread Colin Guthrie
tedd wrote: $actions $words It pretty much goes without saying. So I wont. My actions say it for me without words. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread Kaleb Pomeroy
A ticket, a tasket, a red and yellow basket -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Friday, July 06, 2007 2:59 AM To: Daniel Brown Cc: Larry Garfield; php-general@lists.php.net Subject: Re: [PHP] Re: PHP Brain Teasers Daniel Brown wrote: Let's get

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread tedd
At 11:00 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 22:44 -0400, tedd wrote: At 4:48 PM -0400 7/5/07, Daniel Brown wrote: On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread Paul Novitski
At 7/5/2007 01:45 PM, Daniel Brown wrote: $objects-original_image = http://www.sewterific.com/images/Just%20Baskets/SmPicnicBasket.jpg;; $_SCRIPT[word] = task; $_SCRIPT[otherword] = ticket; $update_word1 = $_SCRIPT[word].et; $rgb1 = 134,89,32; $rgb2 = 231,223,48;

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread Tijnema
On 7/6/07, tedd [EMAIL PROTECTED] wrote: At 11:00 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 22:44 -0400, tedd wrote: At 4:48 PM -0400 7/5/07, Daniel Brown wrote: On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote:

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread Daniel Brown
On 7/6/07, Paul Novitski [EMAIL PROTECTED] wrote: Without bothering to run the code I'd say a tisket, a tasket, a green and yellow basket. Very close. The RGB values actually give away the colors (brown and yellow), and through string replacement and appending, the words `task` and

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread Robert Cummings
On Fri, 2007-07-06 at 10:08 -0400, tedd wrote: At 11:00 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 22:44 -0400, tedd wrote: At 4:48 PM -0400 7/5/07, Daniel Brown wrote: On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread tedd
At 10:24 AM -0400 7/6/07, Robert Cummings wrote: On Fri, 2007-07-06 at 10:08 -0400, tedd wrote: I doubt that one can demarcate the non-chicken parents from the chicken offspring. So... it is perplexing. We don't need to demarcate, we only need to know that it happened. Yes, but knowing

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread tedd
At 4:16 PM +0200 7/6/07, Tijnema wrote: From which point in the evolution do you call it a chicken egg? See it like bytes, is a fish egg, and is a chicken egg, then it went from fish egg to chicken egg like this: 0001 0011 0111 0001 0011 0111

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread Tijnema
On 7/7/07, tedd [EMAIL PROTECTED] wrote: At 4:16 PM +0200 7/6/07, Tijnema wrote: From which point in the evolution do you call it a chicken egg? See it like bytes, is a fish egg, and is a chicken egg, then it went from fish egg to chicken egg like this: 0001 0011

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread Robert Cummings
On Fri, 2007-07-06 at 21:40 -0400, tedd wrote: At 10:24 AM -0400 7/6/07, Robert Cummings wrote: On Fri, 2007-07-06 at 10:08 -0400, tedd wrote: I doubt that one can demarcate the non-chicken parents from the chicken offspring. So... it is perplexing. We don't need to demarcate, we only

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread heavyccasey
Isn't this a PHP list? Why is there discussion about chickens? if ($this == PHP List) { unset('chicken discussion!'); } On 7/6/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-07-06 at 21:40 -0400, tedd wrote: At 10:24 AM -0400 7/6/07, Robert Cummings wrote: On Fri, 2007-07-06 at

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Robert Cummings
On Thu, 2007-07-05 at 10:19 -0400, Daniel Brown wrote: An easy one going on a previous theme. And see? Every so often, I come up with some good ideas like this thread albeit more intrusive than productive :-\ ? global $eggs; global $chickens; function hatch($eggs) {

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Daniel Brown
On 7/4/07, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-07-04 at 19:38 +0100, Colin Guthrie wrote: Robert Cummings wrote: For every action there is an equal and opposite reaction. Thanks Abe, Sir Abraham Newton - father of modern mechanics! It's the new physics where you have to

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread tedd
$which = isset($_GET['chicken']) ? $_GET['egg'] : null; Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Kaleb Pomeroy
Which came first, the chicken or the egg? -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Thursday, July 05, 2007 2:56 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: PHP Brain Teasers $which = isset($_GET['chicken']) ? $_GET['egg'] : null; Cheers, tedd

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Daniel Brown
On 7/5/07, tedd [EMAIL PROTECTED] wrote: $which = isset($_GET['chicken']) ? $_GET['egg'] : null; Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Robert Cummings
On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the egg? The egg, fish were laying them long before chickens walked the earth :) Cheers, Rob. -- .. | InterJinn Application Framework -

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Daniel Brown
Let's get obscure try to guess it before running the code. It actually shouldn't be difficult. ? class Brainteaser { function paint($original_image,$rgb_string1,$rgb_string2,$input1,$input2) { header(Content-type: image/png); $im = imagecreatefromjpeg($original_image);

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Daniel Brown
On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the egg? The egg, fish were laying them long before chickens walked the earth :) Yeah, good point, smartass. ;-P -- Daniel P. Brown [office]

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Robert Cummings
On Thu, 2007-07-05 at 16:08 -0400, Daniel Brown wrote: That's the question that still perplexes even the greatest of minds. I've never found it very perplexing :| Cheers, Rob. -- .. | InterJinn Application Framework -

[PHP] Re: PHP Brain Teasers

2007-07-05 Thread Colin Guthrie
Chris Boget wrote: I wasn't sure if this one was done well enough; I guess it wasn't. The answer is 'Dropping like flies'. :p Well you can't make it too easy... I like it :) (didn't get it but I like it!!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread tedd
At 4:17 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 16:08 -0400, Daniel Brown wrote: That's the question that still perplexes even the greatest of minds. I've never found it very perplexing :| Cheers, Rob. Yeah, but he did say the greatest of minds. :-) Cheers, tedd

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Robert Cummings
On Thu, 2007-07-05 at 22:37 -0400, tedd wrote: At 4:17 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 16:08 -0400, Daniel Brown wrote: That's the question that still perplexes even the greatest of minds. I've never found it very perplexing :| Cheers, Rob. Yeah,

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread tedd
At 4:48 PM -0400 7/5/07, Daniel Brown wrote: On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the egg? The egg, fish were laying them long before chickens walked the earth :) Yeah, good point,

Re: [PHP] Re: PHP Brain Teasers

2007-07-05 Thread Robert Cummings
On Thu, 2007-07-05 at 22:44 -0400, tedd wrote: At 4:48 PM -0400 7/5/07, Daniel Brown wrote: On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the egg? The egg, fish were laying them long before

[PHP] Re: PHP Brain Teasers

2007-07-04 Thread Colin Guthrie
Jochem Maas wrote: Jochem Maas wrote: three for the price of one, cheap at half the price ... for ($me = 1; $you = $me; $me++); One for me and one for you? Everything that is mine is yours? To me, to you? $u = create_function(\$bond, if (\$bond 2) echo \live\; else die();)

[PHP] Re: PHP Brain Teasers

2007-07-04 Thread Colin Guthrie
Robert Cummings wrote: On Tue, 2007-07-03 at 21:26 +0100, David Restall - System Administrator wrote: Hi, there are two in this one :- function Cat($Danger = ) { static int $Lives = 9; if (preg_match(/^curiosity$/i, $Danger)) die(Cat Killed); $Threats

Re: [PHP] Re: PHP Brain Teasers (SPOILER)

2007-07-04 Thread Jochem Maas
Colin Guthrie wrote: Jochem Maas wrote: Jochem Maas wrote: three for the price of one, cheap at half the price ... for ($me = 1; $you = $me; $me++); One for me and one for you? correct! Everything that is mine is yours? To me, to you? $u = create_function(\$bond, if (\$bond 2)

[PHP] Re: PHP Brain Teasers

2007-07-04 Thread tedd
Hi, there are two in this one :- function Cat($Danger = ) { static int $Lives = 9; if (preg_match(/^curiosity$/i, $Danger)) die(Cat Killed); $Threats = array(dog, flu, fall, drowning); if (in_array(strtolower($Danger), $Threats))

Re: [PHP] Re: PHP Brain Teasers

2007-07-04 Thread tedd
Try this: -(4 * 20 + 7) tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP Brain Teasers

2007-07-04 Thread Jochem Maas
this one should be easy: function work($v) { echo $v,; } foreach(array_merge(range(9,12),range(1,5)) as $ing) work($ing); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: PHP Brain Teasers

2007-07-04 Thread Colin Guthrie
Jochem Maas wrote: this one should be easy: function work($v) { echo $v,; } foreach(array_merge(range(9,12),range(1,5)) as $ing) work($ing); dollyWorkin' 9 til' 5/dolly On a similar theme: function jack($all) { static int $play = 0; if ($all == 'work' !$play) return

[PHP] Re: PHP Brain Teasers

2007-07-04 Thread Colin Guthrie
Stut wrote: class Here { private $chickens; } -Stut What you do in your private live with chickens is a mystery to us all Stut.. :p Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP Brain Teasers

2007-07-04 Thread Zoltán Németh
2007. 07. 4, szerda keltezéssel 16.20-kor Colin Guthrie ezt írta: Jochem Maas wrote: this one should be easy: function work($v) { echo $v,; } foreach(array_merge(range(9,12),range(1,5)) as $ing) work($ing); dollyWorkin' 9 til' 5/dolly On a similar theme: function

Re: [PHP] Re: PHP Brain Teasers

2007-07-04 Thread Stut
Colin Guthrie wrote: Stut wrote: class Here { private $chickens; } -Stut What you do in your private live with chickens is a mystery to us all Stut.. :p Nobody 'ere but us chickens. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Re: PHP Brain Teasers

2007-07-04 Thread Larry Garfield
On Wednesday 04 July 2007, tedd wrote: Try this: -(4 * 20 + 7) tedd Four score and seven years ago... Thanks Abe. :-) Try this one: foreach ($actions as $action) { $actions[] = -$action; } This is fun. :-) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED]

[PHP] Re: PHP Brain Teasers

2007-07-04 Thread Colin Guthrie
Larry Garfield wrote: Try this one: foreach ($actions as $action) { $actions[] = -$action; } This is fun. :-) Every action has an equal and opposite reaction! I think I'm addicted. We should publish a book. It would rival sudoku! Col -- PHP General Mailing List

Re: [PHP] Re: PHP Brain Teasers

2007-07-04 Thread Robert Cummings
On Wed, 2007-07-04 at 12:31 -0500, Larry Garfield wrote: On Wednesday 04 July 2007, tedd wrote: Try this: -(4 * 20 + 7) tedd Four score and seven years ago... Thanks Abe. :-) Try this one: foreach ($actions as $action) { $actions[] = -$action; } This is fun. :-) For

Re: [PHP] Re: PHP Brain Teasers

2007-07-04 Thread Robert Cummings
On Wed, 2007-07-04 at 14:26 -0400, Robert Cummings wrote: On Wed, 2007-07-04 at 12:31 -0500, Larry Garfield wrote: On Wednesday 04 July 2007, tedd wrote: Try this: -(4 * 20 + 7) tedd Four score and seven years ago... Thanks Abe. :-) Try this one: foreach

[PHP] Re: PHP Brain Teasers

2007-07-04 Thread Colin Guthrie
Robert Cummings wrote: For every action there is an equal and opposite reaction. Thanks Abe, Sir Abraham Newton - father of modern mechanics! :p -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP Brain Teasers

2007-07-04 Thread Robert Cummings
On Wed, 2007-07-04 at 19:38 +0100, Colin Guthrie wrote: Robert Cummings wrote: For every action there is an equal and opposite reaction. Thanks Abe, Sir Abraham Newton - father of modern mechanics! It's the new physics where you have to lobby to get things to move :/ Cheers, Rob. --

[PHP] Re: PHP Brain Teasers

2007-07-03 Thread Colin Guthrie
Robert Cummings wrote: On Tue, 2007-07-03 at 02:17 -0500, Richard Lynch wrote: On Tue, June 26, 2007 7:14 pm, Robert Cummings wrote: On Tue, 2007-06-26 at 17:00 -0700, Eric Newberry wrote: I think I have to answer to this one: 'If at first you don't succeed try, try again'. Here's another

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Colin Guthrie [EMAIL PROTECTED] wrote: Robert Cummings wrote: On Tue, 2007-07-03 at 02:17 -0500, Richard Lynch wrote: On Tue, June 26, 2007 7:14 pm, Robert Cummings wrote: On Tue, 2007-06-26 at 17:00 -0700, Eric Newberry wrote: I think I have to answer to this one: 'If at first

[PHP] Re: PHP Brain Teasers

2007-07-03 Thread Colin Guthrie
Daniel Brown wrote: Ahh well, how about this: ?php abstract class wood { protected function the() { } } class thetrees extends wood { public function foo() { } } $u = new thetrees(); $u-wood(); // Blerg If a tree falls in the woods, and no one is there to

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 19:54 +0100, Colin Guthrie wrote: Robert Cummings wrote: On Tue, 2007-07-03 at 02:17 -0500, Richard Lynch wrote: On Tue, June 26, 2007 7:14 pm, Robert Cummings wrote: On Tue, 2007-06-26 at 17:00 -0700, Eric Newberry wrote: I think I have to answer to this one: 'If at

[PHP] Re: PHP Brain Teasers

2007-07-03 Thread Colin Guthrie
Jay Blanchard wrote: [snip] if($x == 0.01 || $x == 1.0){ $y = in; } [/snip] Anyone? I'm struggling. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 20:00 +0100, Colin Guthrie wrote: Daniel Brown wrote: Ahh well, how about this: ?php abstract class wood { protected function the() { } } class thetrees extends wood { public function foo() { } } $u = new thetrees();

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 20:18 +0100, Colin Guthrie wrote: Jay Blanchard wrote: [snip] if($x == 0.01 || $x == 1.0){ $y = in; } [/snip] Anyone? I'm struggling. I'm not getting any lightbulbs either :/ Cheers, Rob. --

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/3/07, Colin Guthrie [EMAIL PROTECTED] wrote: Jay Blanchard wrote: [snip] if($x == 0.01 || $x == 1.0){ $y = in; } [/snip] Anyone? I'm struggling. Col -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 15:26 -0400, Robert Cummings wrote: On Tue, 2007-07-03 at 20:18 +0100, Colin Guthrie wrote: Jay Blanchard wrote: [snip] if($x == 0.01 || $x == 1.0){ $y = in; } [/snip] Anyone? I'm struggling. I'm not getting any lightbulbs either :/

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Tijnema
On 7/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-07-03 at 15:26 -0400, Robert Cummings wrote: On Tue, 2007-07-03 at 20:18 +0100, Colin Guthrie wrote: Jay Blanchard wrote: [snip] if($x == 0.01 || $x == 1.0){ $y = in; } [/snip] Anyone? I'm

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Colin Guthrie [EMAIL PROTECTED] wrote: Jay Blanchard wrote: [snip] if($x == 0.01 || $x == 1.0){ $y = in; } [/snip] Anyone? I'm struggling. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Daniel P.

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Jim Lucas
Colin Guthrie wrote: Robert Cummings wrote: On Tue, 2007-07-03 at 02:17 -0500, Richard Lynch wrote: On Tue, June 26, 2007 7:14 pm, Robert Cummings wrote: On Tue, 2007-06-26 at 17:00 -0700, Eric Newberry wrote: I think I have to answer to this one: 'If at first you don't succeed try, try

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 21:41 +0200, Tijnema wrote: On 7/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-07-03 at 15:26 -0400, Robert Cummings wrote: On Tue, 2007-07-03 at 20:18 +0100, Colin Guthrie wrote: Jay Blanchard wrote: [snip] if($x == 0.01 || $x == 1.0){

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Tijnema
On 7/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-07-03 at 21:41 +0200, Tijnema wrote: On 7/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-07-03 at 15:26 -0400, Robert Cummings wrote: On Tue, 2007-07-03 at 20:18 +0100, Colin Guthrie wrote: Jay Blanchard

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 21:54 +0200, Tijnema wrote: On 7/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-07-03 at 21:41 +0200, Tijnema wrote: On 7/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-07-03 at 15:26 -0400, Robert Cummings wrote: On Tue, 2007-07-03 at

[PHP] Re: PHP Brain Teasers

2007-07-03 Thread Colin Guthrie
Robert Cummings wrote: Your hint was too good :) Can't see the woods for the trees. :D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: PHP Brain Teasers

2007-07-03 Thread David Restall - System Administrator
Hi, there are two in this one :- function Cat($Danger = ) { static int $Lives = 9; if (preg_match(/^curiosity$/i, $Danger)) die(Cat Killed); $Threats = array(dog, flu, fall, drowning); if (in_array(strtolower($Danger), $Threats))

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 21:26 +0100, David Restall - System Administrator wrote: Hi, there are two in this one :- function Cat($Danger = ) { static int $Lives = 9; if (preg_match(/^curiosity$/i, $Danger)) die(Cat Killed); $Threats = array(dog,

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Jochem Maas
three for the price of one, cheap at half the price ... for ($me = 1; $you = $me; $me++); $u = create_function(\$bond, if (\$bond 2) echo \live\; else die();) $u();$u();$u(); $I = null; sleep(10); $I = rear(); function rear() {}; -- PHP General Mailing

Re: [PHP] Re: PHP Brain Teasers

2007-07-03 Thread Jochem Maas
Jochem Maas wrote: three for the price of one, cheap at half the price ... for ($me = 1; $you = $me; $me++); $u = create_function(\$bond, if (\$bond 2) echo \live\; else die();) $u();$u();$u(); this one here should have been: $u = create_function(\$bond, if (\$bond

Re: [PHP] Re: PHP Brain Teasers

2007-06-27 Thread clive
?php class money { LOL, a penny saved is a penny earned -- Regards, Clive. Real Time Travel Connections {No electrons were harmed in the creation, transmission or reading of this email. However, many were excited and some may well have enjoyed the experience.} -- PHP General

[PHP] Re: PHP Brain Teasers (SPOILER + new one)

2007-06-27 Thread Colin Guthrie
Robert Cummings wrote: On Tue, 2007-06-26 at 17:00 -0700, Eric Newberry wrote: I think I have to answer to this one: 'If at first you don't succeed try, try again'. Here's another one... ?php $x = rand( 1, 20 ); for( $i = 0; $i $x; $i++ ); while( --$i 0 ); ?

Re: [PHP] Re: PHP Brain Teasers

2007-06-27 Thread Stut
Colin Guthrie wrote: Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done Here's another quickie: Dead simple one! ?php function x($x) { switch ($x) { case 1: return 'bitten'; case 2:

[PHP] Re: PHP Brain Teasers

2007-06-27 Thread David Restall - System Administrator
Hi, Colin Guthrie wrote: Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done Here's another quickie: Dead simple one! ?php function x($x) { switch ($x) { case 1:

Re: [PHP] Re: PHP Brain Teasers

2007-06-27 Thread Stut
David Restall - System Administrator wrote: Hi, Colin Guthrie wrote: Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done Here's another quickie: Dead simple one! ?php function x($x) { switch

  1   2   >