Re: [PHP] PHP Brain Teasers

2007-07-06 Thread Daniel Brown
On 7/5/07, tedd <[EMAIL PROTECTED]> wrote: My favorite. Fan-freaking-tastic! I've never seen it before (I live under a rock), but it has so many potential uses. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net

Re: [PHP] PHP Brain Teasers

2007-07-06 Thread Brice
On 7/6/07, tedd <[EMAIL PROTECTED]> wrote: My favorite. End of the world. Great! Brice 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] PHP Brain Teasers

2007-07-06 Thread Jochem Maas
tedd wrote: > > 2b || !2b this is not javascript dude. $_2b | ~$_2b; that said this is one of the coolest so far, nice one tedd. > > Cheers, > > tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Brain Teasers

2007-07-05 Thread heavyccasey
To be.. or not to be? On 7/5/07, tedd <[EMAIL PROTECTED]> wrote: 2b || !2b 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 -- PHP General Ma

RE: [PHP] PHP Brain Teasers

2007-07-05 Thread tedd
At 9:20 PM +0100 7/5/07, Chris Boget wrote: while( TRUE ) { $actions++; $words--; } $bets = array(1,2,3,4,5); unset( $bets ); $arr = array( 'this', 'that', 'times' ); $arr[] = 'behind'; for( $i = 0; $i <= 6; $i++ ) { $deep++; } for( $i = 0; $i <= 5; $i++ ) { $flies--; } thnx, Chris

RE: [PHP] PHP Brain Teasers

2007-07-05 Thread tedd
My favorite. 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] PHP Brain Teasers

2007-07-05 Thread tedd
2b || !2b 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] PHP Brain Teasers

2007-07-05 Thread Chris Boget
> "Actions speak louder than words." Yup. > "All bets are off." Indeed. > "Behind the times." Correct. > "Deep Six." Got it. > > for( $i = 0; $i <= 5; $i++ ) { > > $flies--; > > } > "Time flies backwards?" // Not sure on this one. I wasn't sure if this one was done well enough; I guess

Re: [PHP] PHP Brain Teasers

2007-07-05 Thread Daniel Brown
On 7/5/07, Chris Boget <[EMAIL PROTECTED]> wrote: while( TRUE ) { $actions++; $words--; } "Actions speak louder than words." $bets = array(1,2,3,4,5); unset( $bets ); "All bets are off." $arr = array( 'this', 'that', 'times' ); $arr[] = 'behind'; "Behind the times." for( $i = 0

RE: [PHP] PHP Brain Teasers

2007-07-05 Thread Chris Boget
while( TRUE ) { $actions++; $words--; } $bets = array(1,2,3,4,5); unset( $bets ); $arr = array( 'this', 'that', 'times' ); $arr[] = 'behind'; for( $i = 0; $i <= 6; $i++ ) { $deep++; } for( $i = 0; $i <= 5; $i++ ) { $flies--; } thnx, Chris -- PHP General Mailing List (http://www.php.ne

Re: [PHP] PHP Brain Teasers

2007-07-04 Thread Robert Cummings
On Wed, 2007-07-04 at 10:18 -0400, tedd wrote: > > $chickens = 1000; > $roost = 0 > $home = false; > > while ($chickens != $roost) >{ >$chickens--; >$roost++; >} > > $home = true; When the chickens come home to roost. Cheers, Rob. -- .--

Re: [PHP] PHP Brain Teasers

2007-07-04 Thread Stut
tedd wrote: $chickens = 1000; $roost = 0 $home = false; while ($chickens != $roost) { $chickens--; $roost++; } $home = true; The chickens have come home to roost. class Here { private $chickens; } -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To u

Re: [PHP] PHP Brain Teasers

2007-07-04 Thread tedd
$chickens = 1000; $roost = 0 $home = false; while ($chickens != $roost) { $chickens--; $roost++; } $home = true; Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: htt

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 18:09 -0400, Daniel Brown wrote: > > "The first thing we do, let's kill all the lawyers." Let's wait a few more years, I like my soilent green fresh. Cheers, Rob. -- .. | InterJinn Application Framework - http:

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Stut
Daniel Brown wrote: On 7/3/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] > Another...(way easy) Y'think? Heh. > $one = "six"; > $other = "half-dozen"; [/snip] function esquireEliminate($x){ unset($x); } $lawyers = 10; for($i = 0; $i < $lawyers; $i++){ eliminateE

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] > Another...(way easy) Y'think? Heh. > $one = "six"; > $other = "half-dozen"; [/snip] function esquireEliminate($x){ unset($x); } $lawyers = 10; for($i = 0; $i < $lawyers; $i++){ eliminateEsquire($i); } Shakes

RE: [PHP] PHP Brain Teasers

2007-07-03 Thread Jay Blanchard
[snip] > Another...(way easy) Y'think? Heh. > $one = "six"; > $other = "half-dozen"; [/snip] function esquireEliminate($x){ unset($x); } $lawyers = 10; for($i = 0; $i < $lawyers; $i++){ eliminateEsquire($i); } Shakespeare has his day in code! -- PHP General Mailing Lis

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] if (goose($its)) { $gander = $its; } [/snip] What's good for the goose is good for the gander. [snip] for ($things = 1; $things > 0; $things++) { for ($x = 0; $x < $things; $x++) { $they = "the same"; } } [/snip]

RE: [PHP] PHP Brain Teasers

2007-07-03 Thread Jay Blanchard
[snip] if (goose($its)) { $gander = $its; } [/snip] What's good for the goose is good for the gander. [snip] for ($things = 1; $things > 0; $things++) { for ($x = 0; $x < $things; $x++) { $they = "the same"; } } [/snip] The more things change the more they stay the

RE: [PHP] PHP Brain Teasers

2007-07-03 Thread John
MAIL PROTECTED] > Sent: Tuesday, July 03, 2007 3:13 PM > To: Jay Blanchard > Cc: Paul Novitski; php-general@lists.php.net > Subject: Re: [PHP] PHP Brain Teasers > > On 7/3/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: > > Another...(way easy) > > Y&

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: Another...(way easy) Y'think? Heh. $one = "six"; $other = "half-dozen"; -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

RE: [PHP] PHP Brain Teasers

2007-07-03 Thread Jay Blanchard
[snip] In for a penny, in for a pound. Metric, that is! Correct! [/snip] Another...(way easy) $one = "six"; $other = "half-dozen"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Tijnema
On 7/3/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] if($x == 0.01 || $x == 1.0){ $y = "in"; } [/snip] Anyone? Hint? ;) Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph

RE: [PHP] PHP Brain Teasers

2007-07-03 Thread Jay Blanchard
[snip] At 7/3/2007 12:11 PM, Jay Blanchard wrote: >[snip] >if($x == 0.01 || $x == 1.0){ >$y = "in"; >} >[/snip] In for a penny, in for a pound. Metric, that is! [/snip] Correct! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] PHP Brain Teasers

2007-07-03 Thread Paul Novitski
At 7/3/2007 12:11 PM, Jay Blanchard wrote: [snip] if($x == 0.01 || $x == 1.0){ $y = "in"; } [/snip] In for a penny, in for a pound. Metric, that is! Regards, Paul __ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.com -- PHP General Mailing List (ht

RE: [PHP] PHP Brain Teasers

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

RE: [PHP] PHP Brain Teasers

2007-07-03 Thread Jay Blanchard
[snip] Ok, I'll play. Phrase: one = rand(1,100); [/snip] One in a million. Still waiting to see if who gets the last one I posted. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread tedd
Ok, I'll play. Phrase: one = rand(1,100); 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] PHP Brain Teasers

2007-07-03 Thread Jay Blanchard
[snip] > if($x == 0.01 || $x == 1.0){ > $y = "in"; > } > > > "One in a thousand" ? [/snip] Nope. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] > > So I'll double-whammy it with a "Name That Tune" factor: > > > > > class Thread { > > var $wheel; > > function Thread (){ > >$this->wheel = 'roun\''; > > } > > } > > while($wheel = new Thread()); > > ?>

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] > if($x == 0.01 || $x == 1.0){ > $y = "in"; > } > > > "One in a thousand" ? [/snip] Nope. Yes it is, you just don't know it yet. ;-P -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- P

RE: [PHP] PHP Brain Teasers

2007-07-03 Thread Jay Blanchard
[snip] > > So I'll double-whammy it with a "Name That Tune" factor: > > > > > class Thread { > > var $wheel; > > function Thread (){ > >$this->wheel = 'roun\''; > > } > > } > > while($wheel = new Thread()); > > ?> "The wheel goes roun and roun" [sic] [/snip] if($x

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Robert Cummings <[EMAIL PROTECTED]> wrote: On Tue, 2007-07-03 at 10:36 -0400, Daniel Brown wrote: > > > A similar one: > > function sing($ignore) { > echo "It's a song!\n"; > } > > (float) $bus; > $bus = 14.750; > while($wheels = round($bus,2)) { > sing($wheels); >

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Robert Cummings
On Tue, 2007-07-03 at 10:36 -0400, Daniel Brown wrote: > > > A similar one: > > function sing($ignore) { > echo "It's a song!\n"; > } > > (float) $bus; > $bus = 14.750; > while($wheels = round($bus,2)) { > sing($wheels); > } > ?> Well when you say it like that... you trigge

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Daniel Brown <[EMAIL PROTECTED]> wrote: On 7/3/07, Robert Cummings <[EMAIL PROTECTED]> 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 t

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Daniel Brown
On 7/3/07, Robert Cummings <[EMAIL PROTECTED]> 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 suc

Re: [PHP] PHP Brain Teasers

2007-07-03 Thread Robert Cummings
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] PHP Brain Teasers

2007-07-03 Thread Richard Lynch
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 one... > > > $x = rand( 1, 20 ); > for( $i = 0; $i < $

Re: [PHP] PHP Brain Teasers [SPOILER]

2007-06-29 Thread Daniel Brown
On 6/29/07, clive <[EMAIL PROTECTED]> wrote: ok this one should be easy: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Blind as a bat. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General M

Re: [PHP] PHP Brain Teasers

2007-06-29 Thread clive
ok this one should be easy: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Brain Teasers

2007-06-27 Thread Jochem Maas
Daniel Brown wrote: >What the hell? Why not start a thread that can be fun and ... here's a easy one: interface Currency {} interface Employee {} class Peanut implements Currency {} class Primate implements Employee {} abstract class HeadHunter { static function match(Currency $c) {

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Eric Newberry
- Original Message - From: "Robert Cummings" <[EMAIL PROTECTED]> To: "Eric Newberry" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 26, 2007 5:14 PM Subject: Re: [PHP] PHP Brain Teasers On Tue, 2007-06-26 at 17:00 -0700, Eric Newberry wrote: I think I

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Robert Cummings
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... 0 ); ?> Cheers, Rob. -- .. | InterJinn Application Framework - h

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Eric Newberry
I think I have to answer to this one: 'If at first you don't succeed try, try again'. Eric getMessage()."\n"; } } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Tijnema
On 6/26/07, Jim Moseby <[EMAIL PROTECTED]> wrote: > On 6/26/07, Jim Moseby <[EMAIL PROTECTED]> wrote: > > > > > > Jim, I didn't get any parse errors when I tested it, it just > > > output the stuff. You're right though that is what > they say > > > > > > > > > Bah - thwarted (again)

RE: [PHP] PHP Brain Teasers

2007-06-26 Thread Jim Moseby
> On 6/26/07, Jim Moseby <[EMAIL PROTECTED]> wrote: > > > > > > Jim, I didn't get any parse errors when I tested it, it just > > > output the stuff. You're right though that is what > they say > > > > > > > > > Bah - thwarted (again) by PHP4. :( > > > > How so? I didn't use any

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Jochem Maas
Daniel Brown wrote: > On 6/26/07, Jim Moseby <[EMAIL PROTECTED]> wrote: >> > >> > Jim, I didn't get any parse errors when I tested it, it just >> > output the stuff. You're right though that is what they say >> > >> >> >> Bah - thwarted (again) by PHP4. :( >> > >How so? I didn't

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Daniel Brown
On 6/26/07, Jim Moseby <[EMAIL PROTECTED]> wrote: > > Jim, I didn't get any parse errors when I tested it, it just > output the stuff. You're right though that is what they say > Bah - thwarted (again) by PHP4. :( How so? I didn't use any 5th Generation-specific code -

RE: [PHP] PHP Brain Teasers

2007-06-26 Thread Jim Moseby
> > Jim, I didn't get any parse errors when I tested it, it just > output the stuff. You're right though that is what they say > Bah - thwarted (again) by PHP4. :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Daniel Brown
On 6/26/07, Tijnema <[EMAIL PROTECTED]> wrote: On 6/26/07, Daniel Brown <[EMAIL PROTECTED]> 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 > anywhere else yet, but I wouldn't be surprised if it has been. Let

RE: [PHP] PHP Brain Teasers

2007-06-26 Thread Jim Moseby
> So here's the first one (it's simple): > > > function at($level) { > $level == 10 ? $ret = "winner" : ''; > $level == 15 ? $ret = "try" : ''; > $level == 20 ? $ret = "first" : ''; > $level == 25 ? $ret = "user" : ''; > $level == 30 ? $ret = "place" :

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Tijnema
On 6/26/07, Daniel Brown <[EMAIL PROTECTED]> 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 anywhere else yet, but I wouldn't be surprised if it has been. Let's put together some names, phrases, and other stuff

[PHP] PHP Brain Teasers

2007-06-26 Thread Daniel Brown
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 anywhere else yet, but I wouldn't be surprised if it has been. Let's put together some names, phrases, and other stuff expressed as PHP code and see who can come up with a