|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
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
|
|||
|
|||
|
some questions
Hi everybody!
To create the code I need some explanations... 1)As I supposed it will be a 6X6 grid and we must fill with words.. Must be all the grid completed and can be words put orizontal or vertical??? 2)I am sorry but I don't understand the output method... Thanks for bad english and for understanding.. Steffan |
|
#2
|
|||
|
|||
|
RE: some questions
Every tile in the grid must have a letter on it. This does not mean that every letter will be used in a word.
Yes, words will run either horizontal or vertical. They must be readable from left to right or top to bottom. What don't you understand about the output method? |
|
#3
|
|||
|
|||
|
RE: some questions
Hi, i am new here. Since there are so many opics already about the contest i thought to post my questions to this and not start a new one. I hope Matt will see it. Anyway on to the questions and clarifications.
"Output: The method of output is simply to output a very simple HTML file that has an opening html and body tag (each followed by a endofline), the total score of the board (again followed by an endofline), the number of words on the board (followed by a endofline), each word you created (each terminated by an endofline), and then a closing body and html tag (each also followed by an endofline)." - I assume by endofline you mean br tags, no? - Do we have the opportunity to print more info than the basic? For example print the grid? "Judging: The winner will be the script that after 30 complete runs has the highest score computed by finding the sum of all 10 runs. The same 30 input.txt files will be used for all scripts." - Did you mean : by finding the sum of all 30 runs? if it is 10 then i dont get it. - To my understanding you will create 30 different input files with each of them having anywhere form 500 to 5000 words. You will then test all those 30 files with every valid contest submission. Am i correct here? - Are you gonna check the results of each script? I mean someone could easily cheat and show a much higher than the actual scor. Maybe everyone should output the grid, so everyone could check if the results are valid. And some general questions. - If i submit my script and then improve it, can i send a second submission? Of course cancelling the first. - Can you tell me if my script is valid to be in the contest if i submit the script? Finally, here is some code to generate your own input files. I dont kno why some people have a problem figure this out, but anyway here it is : |
|
#4
|
||||||||
|
||||||||
|
RE: RE: some questions
Quote:
An endofline is simply a n escape character. Please no br tags. Also, please do not expand the output. I will be parsing it with a php script to automatically judge the scripts. If you vary from the output rules, I will be unable to parse your results. Quote:
Sorry, it should read 30 in all places. I will correct this. Quote:
Cheaters will be found out. If not by me, by someone examining their code after the contest. Because of this I am not too worried about cheaters. Quote:
Yes you can. I would prefer that you hold your script and only submit once however. But, I will accept new submissions up until the deadline if need be. Quote:
No, I will not be checking scripts before judging. Please make sure your script follows the rules before sending it over. I simply don't have the time to test all submissions as they come in.. Quote:
Thanks! |
|
#5
|
|||
|
|||
|
Some more questions ...
2 quotes then a possible problem :
1. "You will receive the name of the input file via the URL ... Your script will be called like so: http://server.com/some/number/of/dirs/scrabble.php?input=somefile.txt" 2. "Your script should run on PHP v4.3 with register_globals OFF." Now the problem : I have installed php on my pc and when i turn the register_globals to off it cannot read the input variable from the url. I dont have any other global variables in the script and i am sure about this because when i hardcode the name of the input file into the script, it runs with no problems at all. Is this a problem with my php (v4.2) or else how are you gonna run the scripts passing them url variables??? Some more questions: As i get it we will have to create an .html file with the content you say on the rules. - Should we call the output file a certain name? for example output.html or scrabble.html? -So can we show anything we want when running the script if the .html file contains only the neccesery content? |
|
#6
|
||||
|
||||
|
RE: Some more questions ...
Quote:
Please read up on how to write scripts with register globals off. Quote:
The output from the script should be the html file going directly to the browser. No need to make another file. |
|
#7
|
|||
|
|||
|
RE: REGISTER GLOBALS IS EVIL
Buddy, friend, amigo.
When you use Register Globals (specifically, when you turn it on) it presents a security hazard if you have bad code. Register Globals, as you know, introduces ANY variable provided by the HTTP request into the global scape. I don't have the time to go into why this is such a bad thing, but trust me. It is. If you're using PHP 4.*, you can grab any variable from the URL line with the array $_GET. For example: http://www.domain.com/script.php?rq1=5&dat=Hey will result in the following for $_GET: Array{ rq1 => 5 dat => Hey } So, then you can get the value of rq1 by using $_GET['rq1']. And when a user introduces a variable trying to maliciously control your script (such as "dat"), it is ignored because it's in $_GET and you don't need to grab $_GET['dat']. As for the POST method with forms, it's $_POST. And (I'm not sure when you could start doing this) you can get ANY request variable with $_REQUEST. Please SHUT REGISTER GLOBALS OFF. That is a disaster waiting to happen with some scripts. |
|
#8
|
|||
|
|||
|
RE: some questions
Thanks you very very much but i have already figured this out
The only difference, is that i use the $HTTP_GET_VARS table to register any url variables. For example : $input = $HTTP_GET_VARS['input']; Is this ok? And a final question : Can i use global variables inside functions with register_globals = off? I have already tried this with no problems but just to make sure since i have put a lot of effort in the algorithm of the script. |
|
#9
|
|||
|
|||
|
RE: some questions
Two things:
HTTP_GET_VARS is depreciated. You should only use it if you can't use _GET. HTTP_GET_VARS must be GLOBALed into a function (e.g. function x (y,z){global $HTTP_GET_VARS; ... } ) to be used in a function. _GET, on the other hand, is what we call SuperGlobal, and it is available everywhere. Good luck with this. |
|
#10
|
|||
|
|||
|
RE: some questions
I dont $_GET it! When i use the variable you say ($input = $_GET['input'];) i get the errors :
Warning: Undefined variable: _GET in D Warning: file("") - No error in D If i use $input = $HTTP_GET_VARS['input']; then no problem at all. Any ideas? |
|
#11
|
|||
|
|||
|
RE: some questions
You're probably running a version of PHP prior to 4.1.0, which is when the superglobals were introduced. As such, you are doing it correctly. $HTTP_GET_VARS, $HTTP_POST_VARS, etc. will still work(for now) on newer versions.
|
|
#12
|
|||
|
|||
|
RE: some questions
Thanks
|
|
#13
|
|||
|
|||
|
RE: RE: some questions
|
|
#14
|
|
|
|