NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Business & Community Discussion Forums > Community > Contests Forum
Reload this Page The first Challenge to kick it off. ( PHP )

Contests Forum Forum for contests, games, trivia and related posts.

Advanced Search
0 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 06-10-2003, 11:09 PM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



The first Challenge to kick it off. ( PHP )


This is going to be the first challenge to kick off the launch of this forum.

The Reward will be a two year domain registration of any .com, .net, or .org domain name!

The challenge:

Create a text file containing the letters a-z all on one line.

Exactly like this:

abcdefghijklmnopqrstuvwxyz

The letters can't contain any delimiters.

Now what you need to do with PHP is figure out a way to open up the text file and sort through and split the letters so you can print each letter to the browser on a separate line.
????: NamePros.com http://www.namepros.com/contests-forum/14835-the-first-challenge-kick-off-php.html

So the end result should be:

a
b
c
d
e
etc..

You must do this using only one echo or print statement.

So
echo 'a';
echo 'b';
echo 'c';
etc..

would not be a valid way of doing it.

These will not be counted as valid either:
echo a<br>b<br>c<br>d<br>etc..
print a<br>b<br>c<br>d<br>etc..

You must figure out another way to do it, any of the above methods will not be accepted.

You'll have to think up some code so you can do it with only one echo or print statement wich will result in each letter being printed on a new line.

You can use all the resources available to you to figure out how to do this!

The first person to post the code that can do it in this thread will be the winner.

Ask in here if you have any questions about this challenge.

We'll try to have atleast one challenge a month with some type of reward, some will be easier and some will be harder.

Good Luck!
deadserious is offline  
Old 06-11-2003, 02:04 AM   #2 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
hmmmmm ill do it when i get in tonight, i take it you want it wprl
adam_uk is offline  
Old 06-11-2003, 02:14 AM   #3 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
am i worthy


http://www.intentio.net/~bass/hello.php
adam_uk is offline  
Old 06-11-2003, 05:55 AM THREAD STARTER               #4 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Well you need to post the code you used so we can so how you did it.
deadserious is offline  
Old 06-11-2003, 07:08 AM   #5 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
oh yeh sorry

PHP Code:
<? 

$table 
"<tr><td>";
$endtable "</tr></td>";

?>

<table>
<? echo $table?> a <? echo $endtable?>
<? 
echo $table?> b <? echo $endtable?>
<? 
echo $table?> c <? echo $endtable?>
<? 
echo $table?> d <? echo $endtable?>
<? 
echo $table?> e <? echo $endtable?>
<? 
echo $table?> f <? echo $endtable?>
<? 
echo $table?> g <? echo $endtable?>
<? 
echo $table?> h <? echo $endtable?>
????: NamePros.com http://www.namepros.com/showthread.php?t=14835
<? 
echo $table?> i <? echo $endtable?>
<? 
echo $table?> j <? echo $endtable?>
<? 
echo $table?> k <? echo $endtable?>
<? 
echo $table?> l <? echo $endtable?>
<? 
echo $table?> m <? echo $endtable?>
<? 
echo $table?> n <? echo $endtable?>
<? 
echo $table?> o <? echo $endtable?>
<? 
echo $table?> p <? echo $endtable?>
<? 
echo $table?> q <? echo $endtable?>
<? 
echo $table?> r <? echo $endtable?>
<? 
echo $table?> s <? echo $endtable?>
<? 
echo $table?> t <? echo $endtable?>
<? 
echo $table?> u <? echo $endtable?>
????: NamePros.com http://www.namepros.com/showthread.php?t=14835
<? 
echo $table?> v <? echo $endtable?>
<? 
echo $table?> w <? echo $endtable?>
<? 
echo $table?> x <? echo $endtable?>
<? 
echo $table?> y <? echo $endtable?>
<? 
echo $table?> z <? echo $endtable?>

</table>
adam_uk is offline  
Old 06-11-2003, 08:07 AM   #6 (permalink)
New Member
Join Date: Feb 2003
Posts: 3
Dan[imported] is an unknown quantity at this point
 



http://www.animebeta.com/contest/

PHP Code:
<?php
????: NamePros.com http://www.namepros.com/showthread.php?t=14835
    $filename 
"letters.txt";
    
$m fopen($filename"r");
    
$contents fread($mfilesize($filename));
    
$contents preg_split("//"$contents);
    foreach(
$contents as $key)
    {
        echo 
"<div>".$key."</div>n";
    }
?>
And the contents of letters.txt is the string you said.

Do I win?

Edit: Adam: The reason that you didn't win was because you should have used only one echo. You used fifty-two. Also, he blatantly stated that you must echo from a text file with all the characters on one line and no other delimiters. You just crudely echoed out every character. Try harder next time.

Edit2: Could I have the $20? I need to renew a domain name and possibly transfer it, more than I need a new one.
__________________
#Dan
Dan[imported] is offline  
Old 06-11-2003, 09:43 AM   #7 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
oh well never mind eh i was at college on the net when i shouldnt have been oh well ill win the next one
adam_uk is offline  
Old 06-11-2003, 11:34 AM THREAD STARTER               #8 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Quote:
Originally posted by adam_uk
oh well never mind eh i was at college on the net when i shouldnt have been oh well ill win the next one
Hey nice effort adam!
deadserious is offline  
Old 06-11-2003, 11:36 AM THREAD STARTER               #9 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Quote:
Originally posted by Dan
????: NamePros.com http://www.namepros.com/showthread.php?t=14835
http://www.animebeta.com/contest/

PHP Code:
<?php
    $filename 
"letters.txt";
    
$m fopen($filename"r");
    
$contents fread($mfilesize($filename));
    
$contents preg_split("//"$contents);
????: NamePros.com http://www.namepros.com/showthread.php?t=14835
    foreach(
$contents as $key)
    {
        echo 
"<div>".$key."</div>n";
    }
?>
And the contents of letters.txt is the string you said.

Do I win?

Edit: Adam: The reason that you didn't win was because you should have used only one echo. You used fifty-two. Also, he blatantly stated that you must echo from a text file with all the characters on one line and no other delimiters. You just crudely echoed out every character. Try harder next time.

Edit2: Could I have the $20? I need to renew a domain name and possibly transfer it, more than I need a new one.
Nice job! That works well.

Check your private messages so we can get your reward settled.
deadserious is offline  
Old 06-11-2003, 11:53 AM THREAD STARTER               #10 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Quote:
Originally posted by adam_uk
hmmmmm ill do it when i get in tonight, i take it you want it wprl
What's wprl
deadserious is offline  
Old 06-11-2003, 12:05 PM   #11 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
i have no idea :S

lol
adam_uk is offline  
Old 06-11-2003, 12:08 PM THREAD STARTER               #12 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



lol that's good cause neither do I.
deadserious is offline  
Old 06-11-2003, 12:41 PM THREAD STARTER               #13 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



And the official winner is Dan! :beer:

Okay Dan has asked that if he only accepted half his reward, if we could get another contest going. So be on the look out for another challenge with another reward soon!

Also feel free to post your ideas and we'll see what we can come up with. :webdev:
deadserious is offline  
Old 06-11-2003, 01:35 PM   #14 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
ol well at least i tried....and failed
adam_uk is offline  
Old 06-11-2003, 01:45 PM THREAD STARTER               #15 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



It was a good effort! ..... There's always nex time.
deadserious is offline  
Old 06-13-2003, 10:58 PM   #16 (permalink)
NamePros Regular
Join Date: Sep 2002
Location: Canada
Posts: 481
DarkDevil is an unknown quantity at this point
 



Heh, yea i didn't even get to try.
__________________
Sometimes I lay awake at night and I ask "Where have I gone wrong?" Then a little voice says "This is going to take more than one night"
DarkDevil is offline  
Old 06-13-2003, 11:00 PM THREAD STARTER               #17 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Well there will be another one soon!

As soon as we can come up with what it's going to be. I haven't been able to think up any more coding ones as of yet, so maybe it'll be logo contest or something next time. I'm trying to think up some coding ones though, so if you all have any ideas feel free to share them.
deadserious is offline  
Old 06-13-2003, 11:24 PM   #18 (permalink)
NamePros Regular
Join Date: Sep 2002
Location: Canada
Posts: 481
DarkDevil is an unknown quantity at this point
 



I have to convert my Visual Basic knowledge into php knowledge... Anything you throw at me i can manage to do in visual basic, and its been months since i've even opened a php file for editing... so i blow with php now. I'll need to get back into it once exams are over and i have my new system up and running
__________________
Sometimes I lay awake at night and I ask "Where have I gone wrong?" Then a little voice says "This is going to take more than one night"
DarkDevil is offline  
Closed Thread


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


 
All times are GMT -7. The time now is 11:59 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger