-
Dec 23, 2002, 12:35 AM
#1
web language challenge
I don't know if this will prove anything but here's a simple challenge.
Write a program in your favourite server-side programming language that does the following:
1.Accepts form input (the input most only contain letters (aA-zZ), and or numbers (0-9)
If there are any other types of characters it should disallow them.
2.Counts the number of words submitted
3.Any numbers(0-9) contained within the input should be highlighted in green (#006600)
4.If numbers are contained, it should find the sum of all the digits in the input.
All the code should be contained in a single file.
the winning entry is the one which uses the least lines of code to pull it off.
entries are welcome in
PHP
ASP
JSP
Python/Zope
GSP
SPYCE
PERL
If you're interested, I'll develop a set of tests that your program must pass.
Object Oriented code is preferred but not required.
any takers?
-
Dec 23, 2002, 10:03 AM
#2
Re:web language challenge
HAHAHA lol, This is great, this is just what was needed to a few months ago.
I am trying to pick up my PHP book again but i think , I will take that [but i may as well do one in perl also] what is the cgi to do, what DB does it connect to, and when do we start
-Kurt
P.s. Good Idea [nothing gets a nonprogrammer like me going like good old competition]
-
Dec 23, 2002, 10:38 AM
#3
Re:web language challenge
Oh this is SWEEET! Very good idea pigeonflight! 8)
To sweeten the pot I've arranged for the winner to receive their choice of either a Digicel or Cable&Wireless new pre-paid phone courtesy of Anbell Agencies Ltd. This should stoke up the programming fire ;D
-
Dec 23, 2002, 11:17 AM
#4
Re:web language challenge
Pot looks sweet to me....longing to see the outcome.
-
Dec 23, 2002, 11:49 AM
#5
Re:web language challenge
No database stuff please. The entire thing should work with a single file.
you can send your code to weblanguage@dbain.com
Also provide a link to an online working version of the code.
I guess since I'll than likely be judgeing I'll be disqualified from the phone.
Entries close Sunday January 5, Midnight Jamaica time
-
Dec 23, 2002, 03:01 PM
#6
Re:web language challenge
More details about rules
-numbers count as words
"2 3 4" would be 3 words
but "23 4" would be 2 words
and "234" would be one word
-the correct sum for
"234 hello2g" would be
2+3+4+2 =
-
Dec 23, 2002, 03:40 PM
#7
Re:web language challenge
Competition Entry: RC1
Author: Karl Morris
Location: http://www.jadirect.com.jm/misc/php/competition.php
Development Language: PHP
Development Time: 58 mins
Object Oriented: No
-
Dec 23, 2002, 05:13 PM
#8
Re:web language challenge
Impressive CKnight, I guess you wasted no time 8) Let's see what the competition has to offer.
-
Dec 23, 2002, 06:14 PM
#9
Re:web language challenge
How many lines of code was that?
-
Dec 23, 2002, 06:16 PM
#10
Re:web language challenge
Here are some quick tests
and the expected output.
(looking forward to the Perl and ASP versions)
test input
===========
1. input:Hello World
expected output:
Hello World (no highlighting)
2 words,sum of digits = 0
2. input:123 456
expected output:
123 456 (all highlighted)
2 words, sum of digits = 21
3. input:123 4 56
expected output:
123 4 56 (all highlighted)
3 words, sum of digits = 21
4. input:l11Z1U7X I4T 341 rocks
expected output:
I 81 ou81 i812(numbers highlighted)
4 words, sum of digits = 29
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules