Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: web language challenge

  1. #1
    Join Date
    Aug 2002
    Posts
    1,236
    Rep Power
    0

    Default 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?

  2. #2
    Join Date
    Jul 2002
    Posts
    228
    Rep Power
    0

    Default 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]

  3. #3
    Join Date
    Jul 2002
    Posts
    5,446
    Rep Power
    10

    Default 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

  4. #4
    Join Date
    Jun 2002
    Posts
    648
    Rep Power
    0

    Default Re:web language challenge

    Pot looks sweet to me....longing to see the outcome.


  5. #5
    Join Date
    Aug 2002
    Posts
    1,236
    Rep Power
    0

    Default 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

  6. #6
    Join Date
    Aug 2002
    Posts
    1,236
    Rep Power
    0

    Default 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 =

  7. #7
    Join Date
    Jul 2002
    Posts
    818
    Rep Power
    0

    Default 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


  8. #8
    Join Date
    Jul 2002
    Posts
    5,446
    Rep Power
    10

    Default Re:web language challenge

    Impressive CKnight, I guess you wasted no time 8) Let's see what the competition has to offer.

  9. #9
    Join Date
    Aug 2002
    Posts
    1,236
    Rep Power
    0

    Default Re:web language challenge

    How many lines of code was that?

  10. #10
    Join Date
    Aug 2002
    Posts
    1,236
    Rep Power
    0

    Default 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
  •