To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Upgrading PHP

Upgrading PHP Issues concerning PHP version upgrades and future releases

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-17-2004, 06:06 PM   #1
ZibingsCoder
Kerflaffles, eh?
 
Join Date: May 2003
Location: Pennsylvania, USA
Posts: 409
A Contest...in PHP 5

Now...it has occured to me, that this forum is relatively less active then certain other forums. I have no idea how to change that.

However, I -do- have an idea for a great PHP 5 contest. Most other contests detail the programmer's ability to utilize the new things found in PHP5, but come on, that gets boring after a while! With that in mind, I'd like to kick things up a notch.

For this contest, you will be required to write fully functional code that looks like something. PHP is a free form language, meaning that it doesn't matter where we put whitespace (within certain restraints). Use -this- bit of functionality and create some ascii art with your PHP program. The winner will get a years free subscription to Penguins 'R Us, Ltd., an LLBean wannabe company that has yet to be created.

No purchase necessary, must be 23 years of age or other in order to qualify for subscription. Thank you, come again.

[Note]
Just to clarify, this is something you must do with the -source code- of your PHP program, not the output.
__________________
Use the PHP tags when posting PHP.
Mark all issues as resolved once your question is answered.

http://amale.zibings.com/
N2 Framework Yverdon (Alpha)

Last edited by ZibingsCoder; 08-17-2004 at 06:08 PM.
ZibingsCoder is offline   Reply With Quote
Old 08-17-2004, 09:10 PM   #2
LordShryku
kung foo code monkey
 
LordShryku's Avatar
 
Join Date: Aug 2002
Location: Occupational Hypnotherapy
Posts: 7,473
Code:
<?/*
        /\   .oOOOOOOo.
       #/   oOOOOOOOOOOo.
      #/   OOOO'    'OOOO.
     #/   OOOO'      'OOOO
    #/    OOOO       .OOOO
   #/              .OOOO'
  #/              .OOOO'
 #/             .OOOO'
#{             .OOOO'
 #\             OOOO'
  #\            OOOO
   #\           JGSO
    #\
     #\         .OO.
      #\        OOOO
       \/       'OO'
*/?>


Last edited by LordShryku; 08-17-2004 at 09:15 PM.
LordShryku is offline   Reply With Quote
Old 08-17-2004, 10:56 PM   #3
ZibingsCoder
Kerflaffles, eh?
 
Join Date: May 2003
Location: Pennsylvania, USA
Posts: 409
Haha..cheater
__________________
Use the PHP tags when posting PHP.
Mark all issues as resolved once your question is answered.

http://amale.zibings.com/
N2 Framework Yverdon (Alpha)
ZibingsCoder is offline   Reply With Quote
Old 08-18-2004, 12:59 AM   #4
planetsim
code | beer > sleep
 
Join Date: Sep 2002
Location: aus
Posts: 4,826
Quote:
must be 23 years of age or other in order
So this means i can be any age does it
__________________
Dont be lazy Search
And use the Manual
Webmobo - Open Source News Script | Portfolio / Blog | Against TCPA
planetsim is offline   Reply With Quote
Old 08-18-2004, 02:52 AM   #5
ZibingsCoder
Kerflaffles, eh?
 
Join Date: May 2003
Location: Pennsylvania, USA
Posts: 409
Twas the point.
__________________
Use the PHP tags when posting PHP.
Mark all issues as resolved once your question is answered.

http://amale.zibings.com/
N2 Framework Yverdon (Alpha)
ZibingsCoder is offline   Reply With Quote
Old 08-18-2004, 06:33 AM   #6
Shrike
Not Yet Involved
 
Shrike's Avatar
 
Join Date: Oct 2003
Location: The Eighth, Sursamen
Posts: 2,254
PHP Code:
<?php

abstract
class Shape {

    
protected $string;
    
protected $strlen;
    
    function
__construct(){
        
$this->string = file_get_contents($_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF']);
        
$this->string = preg_replace("/\\s{2}+|\\t+|\\n+|<\\?php|\\/\\?>/", "", $this->string);
        
$this->strlen = strlen($this->string);
    }
}

interface ShapeI {
    
public function draw();
}

class
Square extends Shape implements ShapeI {

    
private $total;
    
private $rowlen;
    
    
public function __construct($x){
        
parent::__construct();
        
$this->rowlen = $x;
        
$this->total = round($x * $x / 2);
    }
    
    
final public function draw(){
        
$y = 0;
        for(
$i = 0; $i < $this->strlen; $i++){
            echo
$this->string[$i];
            
$y++;
            if(
$y == $this->rowlen){
                echo
"\n";
                
$y = 0;
            }
            if(
$i == ($this->total -1)){
                
$this->strlen - $this->total > 0 ? $r = $this->strlen - $this->total : $r = 0;
                echo
"$r characters were unused";
                return;
            }
        }    
    }
}

$sq = new Square(36);
$sq->draw();

?>
There's a start. Let's see some pretty patterns
__________________
The Hundredth Idiot

Last edited by Shrike; 08-18-2004 at 06:40 AM.
Shrike is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 12:51 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.