This contest is intended for the PHP Programmer with more than
6 months experience. You will be given strict instructions and it's
your job to create the most effective coded solution.
Contest Details:
The rules for this contest are very simple, find supplied word(s)
in a sentence. The word(s) you will find will be intact, but the
sentences will be muddled-up and may have many unused letters.
I will give you 2 blank letters per list, you can use these blanks to
complete words. Blanks can be any letter, but they cannot be the same, for example:
blank 1 = g, blank 2 = h - valid
blank 1 = f, blank 2 = f - invalid
Closing Date:
All entries in by Tuesday 17th June 2003 at 23.59 (GMT)
Submissions:
send your entry to contest@php-editors.com please include a text file
'contact.txt' with your forum username, Full Name and Email Address.
Submissions should be zipped.
Input
The input contains pairs of lists and sentences.
The list gives the words to search for in the following sentence.
Lists are terminated by a comma.
All letters are in lower case.
Words are at most 20 letters long and are seperated by a single space.
Each line is at most 80 characters long.
Sentences may occupy more than one line, and are terminated by a full stop.
You script will be given a text file 'lists.txt' (in the same directory).
Output
For each pair of list and sentence, find the words from the list that
appear in the sentence with the letters shuffled. Print these words
in order of hightest character count, separated by a single space.
Highlight (in red) any letters used from you blanks, all other letters
should be black. If no words from the list match the words in the sentence,
just print a blank line. On the last line print the total number of
letters found (including any blanks used). Each letter can only be used once!!
Sample Input (*UPDATED*)
string constant variable sausages,
tstnacon bleiangrav igtni ksiypappsle.
class function objects hypertext preprocessor,
sslas nyyoitcf teztxrpyhre krtbhwopqowo jksksjajajahshshj.
Sample Output (*UPDATED*)
constant variable string
hypertext objects class
43
Winning
To be in for a chance of winning, you should find as many words as
possible to obtain the highest number of characters. Points are given
for each character used (including blanks). The winner will be the script
with the highest character count. In the event of more than one script
having the same, the script execution time will decide the winner.
Judging:
In the event of a tiebrake (when script execution time is used)
I will execute several runs on each script to obtain an average.
Rules and Restrictions:
Must run on Windows, and Unix systems
Must run with PHP4.2 (register globals off)
No third party PHP extensions ( other than ones supplied with php 4.2 on php.net )
Maximum execution time 60 seconds.
All code must be writen by you !
Prizes:
1st. Nusphere PHPEd
2nd. 1 years subscription to PHP Magazine, Tamplate Tamer, $15 ThinkGeek Voucher
3rd. 1 month free hosting from TheHostingCompany.us. (Platinum Package)