|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Crossword Puzzle results are out.
The results of Crossword Puzzle contest are out, and the happy winner is......... My ;-)
All the scripts an the results can be found in the ftp: ftp://gear21.com/codewalkers/crossingwords/ But now I have some questions: - In the first wordlist.txt used, te word 'nitya-sundara' seems not to be ok with the rules: '# Words in the wordlist.txt will be all lowercase with no special characters. Only characters a-z.' (Is posible some script have failed becouse this extra '-' ??) - The rule '* I run with error_reporting(E_ALL | E_NOTICE)' seems to me a mistake (or a trap). E_ALL is 2047 and E_NOTICE is 8. In default PHP configuration error_reporting is E_ALL & ~E_NOTICE = 2039 (all except notices). In the contest E_ALL | E_NOTICE = 2047 (all or notices). Is this a bug or a trap? I supose some of the coders have tested theirs scripts with E_ALL & ~E_NOTICE, working fine, but then are disqualifieds with E_ALL | E_NOTICE... - I have tested some of the submited scripts. In ALL the solutions i tested (except mine) the coders have considered a 'connector' is also a 'filled in square', thus 4 points (and not 3) for each 'connector' are computed. A 'connector' IS NOT a 'filled in square', see this thread of de forum for clarification: http://codewalkers.com/forum/index.php?action=displaythread&forum=php-contest&id=185&realm=default (If a 'connector' is also a 'filled in square', such as almost everybody have considered, mi script must compute an average of 60 more points in every execution...) Àngel - The happy winner ;-) |
|
#2
|
|||||
|
|||||
|
RE: Crossword Puzzle results are out.
Quote:
That is a bad wordlist on the ftp. I actually did remove that word before testing. Sorry about that. I have updated it on the ftp. Quote:
a trap? It is plainly disclosed that I run with that error reporting. Also from the rules is "It should not display any errors, warnings, or notices.", speaking of the script. It has been a subject of discussion in this forum and has been a stipulation on all previous contests. If rules aren't followed, people will be disqualified. This may seem harsh, but a rule is a rule. If I bend one rule and allow people to slide by, then someone else will want me to bend a different rule... Quote:
A connector is a filled in square. I thought we had clarified that in that thread |
|
#3
|
||||
|
||||
|
RE: RE: Crossword Puzzle results are out.
Quote:
Ok, ok, Matt, is very clear to me, but... 'E_ALL | E_NOTICE' is identical to 'E_ALL' (both are 2047). Then, why not say simply 'E_ALL' in the rules? Is much more clear to all, and i suspect someone is confusing 'E_ALL | E_NOTICE' with the default 'E_ALL & ~E_NOTICE' of PHP. Is for that i questioned if it is a mistake (or a trap). Also, i am new in the forum and have not read previous discusion on this topic, sorry. Quote:
Ooooops! You are right, I am very confused on this topic. In that thread, my example has 3 word of 5 letters any. For two times you have computed 15 letters as 13 points (2 letters that are connectors are not computed as filled in squares). In that thread, finally seems clear to me (stupid me) that a connector can not compute two times, one time as a filled square and other as a connector, but I am worng, I dont have understand this rule, I have confused letters of words (letters in wordlist.txt) with letters of puzzle (letters on screen). Then my script can be disqualified... If anyone considers my script is out of the rules for computing wrongly filled in squares, disqualify-me, please, I dont become annoyed at all. Àngel |
|
#4
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
Nice code, Angel. Can I just suggest or request that you add some comments so that others can figure out what's going on in your script? Thanks!
I guess I'll try for the beginner contest next, cause my attempt was feeble at best. |
|
#5
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
Quote:
Well, I certainly wasn't trying to trick anyone. In fact my intention was the opposite. I was trying to point out to people that notices would be displayed. As for disqualifying your script, I don't plan on it. Your script hurt itself. By not counting the points properly, you only increased your chances of losing. There is such a thing as a simple mistake, and I believe this is one of them. Missing something like the error reporting is just not paying attention to the rules. I would hope that everyone would agree that you are the winner. |
|
#6
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
Ya, mine got disqualified because of this rule. Although I did run it with the given lists (one time for each), and here's the scores I got from it on my test runs:
first: 632 second: 608 third: 617 total: 1857 This was the first contest I entered, I didn't care as much for the prize as I did for the glory. I feel stupid I didn't look into turning the notice off. I figured he was running default without the registered globals (that one I agree with, because registered globals are insecure). |
|
#7
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
Er, I meant turn notice on, not off, well, I turned them on, I'm not getting them:/, maybe someone can help me out, in php.ini I set:
error_reporting = E_ALL | E_NOTICE I'm not getting the notice, does it spit notices to the screen, or do I have to turn log errors on and look in a file? |
|
#8
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
NM, I figured it out, thanks to angels script:
error_reporting(E_ALL); Now I know, and knowing is half the battle to quote an old war cartoon;) This was a weird one, not only did it keep spitting out the notices, it also went well over the timelimit when this setting was turned on (I had to kill it). edit: I just tried to edit this message, had a long argument for why I feel that notices should be allowed to be off in future contests, but this page ate it (or something when I submitted it, hit back it was gone, oh well). -Sager |
|
#9
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
i would also ask Angel to give some discription on how his script works...
and to Matt, i would sugest a future rule: that a winner would have to explain how his script works (in a form of tutorial, maybe) in order to get his reward! this wuold be great for beginers... i would be interested in looking at it also, (i don't consider myself a beginer) because u can always learn smth new. last contest (crossword) got me realy thinking, even doe i didn't have time to enter it... |
|
#10
|
||||
|
||||
|
RE: Crossword Puzzle results are out.
I agree with zombie, this puzzle really got me thinking in terms of how to make an algorithm to be both effective and fast at packing words as tightly as possible. I wish I had more time to submit. I plan on submitting on this next one but I am worried that the error reporting or the command line will trip me up and I don't want to waste my time and submit a piece of code that gets disqualified.
What is the point of the error reporting / notices? Sorry if my questions are foolish, B |
|
#11
|
|||
|
|||
|
RE: RE: Crossword Puzzle results are out.
Quote:
That's what I'm sayin, I think it should be default php settings. Notices don't exactly mean bad code. All they are is using a variable that hasn't been defined yet, I think most of mine were from declaring a variable for scope purposes, or checking to see if a variable was defined or not. -Sager |
|
#12
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
Aw aw!
I forgot to restart Apache after modifing php.ini. I thought I was running with 12 second time-limit and E_ALL|E_NOTICE but the old settings were still off... So I didn't notice these #### 'Undefined offset/index' each time a new element was first time used with '+='. Also the 100's of errors slowed it down a lot. Anyway I have learnt a lot with this E_NOTICE thing, like using isset(), empty()... But just too late! :,( I'll use E_NOTICE from now on as I use '-Wall' with gcc since I know of its existance. But experience says that sometimes '-Wall' complains of something which is good in fact. Hope E_NOTICE will prove better. Anyway, execution times are surprisingly much longer than those with the three wordlist supplied for testing. I have tested also with words taken from English 'words' file. Now I think I should have be more conservative and sent the first-try solution, wich results would have been (with times on a 800MHz machine): 1st go: 49w, 207sq, 69 conn, 659 points (7secs) 2nd go: 39w, 182sq, 50 conn, 527 points (5secs) 3rd go: 48w, 202sq, 65 conn, 637 points (5secs) TOTAL: 1.823 points Buaaaahhhh! So much work and a sleepless night! Hell, I enjoyed it. ¡Enhorabuena, Mr. Fenoy! |
|
#13
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
Aw aw!
I forgot to restart Apache after modifing php.ini. I thought I was running with 12 second time-limit and E_ALL|E_NOTICE but the old settings were still off... So I didn't notice these #### 'Undefined offset/index' each time a new element was first time used with '+='. Also the 100's of errors slowed it down a lot. Anyway I have learnt a lot with this E_NOTICE thing, like using isset(), empty()... But just too late! :,( I'll use E_NOTICE from now on as I use '-Wall' with gcc since I know of its existance. But experience says that sometimes '-Wall' complains of something which is good in fact. Hope E_NOTICE will prove better. Anyway, execution times are surprisingly much longer than those with the three wordlist supplied for testing. I have tested also with words taken from English 'words' file. Now I think I should have be more conservative and sent the first-try solution, wich results would have been (with times on a 800MHz machine): 1st go: 49w, 207sq, 69 conn, 659 points (7secs) 2nd go: 39w, 182sq, 50 conn, 527 points (5secs) 3rd go: 48w, 202sq, 65 conn, 637 points (5secs) TOTAL: 1.823 points Buaaaahhhh! So much work and a sleepless night! Hell, I enjoyed it. ¡Enhorabuena, Mr. Fenoy! Did someone's script spit something as this (mine do almost allways): Code:
S
A P A
M I N
I T K
TARPANA
APSARA
A RAM
R A R
N S A
A A T
R A
A
|
|
#14
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
Goog numbers man,
I did some enhancing after I sent mine in (didn't think I would have much more time to work on it) just for my own efforts, only thing I could improve on is a better average case. I tried different sorting techniques, the best thing I did, but I don't know if it would have been good to send it in, is get rid of all words greater than 7 characters. That did wonders for my average... but little too late, like you said, it was fun. -Sager |
|
#15
|
|||
|
|||
|
RE: Crossword Puzzle results are out.
there should be some <PRE>...
I meant this: Code:
····S·· A·P·A·· M·I·N·· I·T·K·· TARPANA APSARA· ·A·RAM· ·R·A·R· ·N·S·A· ·A·A·T· ···R·A· ···A··· |