|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Command line???
I dont get it, how do you use this command line. I have programmed a lot of php-scripts but never ever have I used something like that..
Matt, tell me: 1) What the *** is the command line? 2) Why use the command line? 3) How do you use the command line in the script? While I'm at it, I have several questions that needs answering! The script-file which we create, what should be written in it considering you have your own judging-script? (Do we really have to create it?) Could we not just create the file move.txt and submit that one? |
|
#2
|
|||
|
|||
|
One other thing
I forgot to add this in my posting:
Should there be only ONE command in the whole input.txt (or was it move.txt, i cant remember?) |
|
#3
|
||||||
|
||||||
|
RE: Command line???
Quote:
The command line is like DOS. Quote:
So that you don't have to run the program inside the construct of a web server. That is, you're just running the straight interpretter. Quote:
If you're using Windows, you just need to open a MSDOS window, CD to where your script is, and run the command php.exe (as many people have mentioned before). You might have to add the location of php.exe to your path in order to make it simple. In Unix, PHP is usually (?) compiled as an Apache module. There is no real way to use PHP on the 'command line' when it's compile as such. You have to have had PHP compiled as a CGI in order to get a full PHP interpretter that can be run on the command line. As other people have already mentioned, placing this at the top of your php script will allow it to run on the command line: #!/PATH/TO/PHP You will also have to change the executable bit. Something like: chmod 755 yourphpscript.php Quote:
While this would obviously not be accepted, even logically why would you do this? a) you would need some sort of programming to output the difference in assignment between red and white (ie. you don't know what color you're going to be until runtime). b) you would have a very dumb robot that would not be able to react to your opponent's moves. |
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > Command line??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|