PHP Contest: Revenge of the Apple Eating Robots
Zack Coburn writes "The latest Codewalkers' PHP Coding Contest invites PHP programmers to write a script in PHP to interface with a judging library and play 'Apple Eating Robots,' a game based on the classic Unix console game called Robots. According to the contest description, the goal is 'to avoid robots, eat apples, and kill robots by forcing them to hit each other in order to get the highest score.' For judging, 'at least 100 rounds will be played. In the end, the sum of all points earned will determine the winner. In the case of a tie, the running time will be the tie-breaker.' According to an e-mail sent out to Codewalkers users, 'The
PHP Coding Contest is now in its third year since inception and touts $2,000 worth of prizes. The first ten places will earn a prize, so even if you
aren't the top winner, you have a chance at winning something.' Prizes for the current contest include Macromedia Studio MX, Zend Studio, PHPEd, and SourceGuardian Pro."
for what on earth do you need a PHP debugger?
you got echo, print, printf, var_dump, print_r, debug_backtrace.
Though http://de3.php.net/manual/en/debugger.php sais there are debugger out there.
But honestly. I have never needed one. As the previous mentioned function did all what I needed to even debug complex scripts.
kindest regards,
mo
PHP has a debugger build in. Check out this php website
yush
even if dmitri is working at zend now, there is http://dd.cron.ru/dbg/ . it's good and free.
I think you were thinking of Yahoo.
h
http://news.com.com/2100-1023-963937.html?tag=l
it's usually distributed as part of a collection called "bsd games", if you use Linux try here.
ex$$
I'm not sure that the Unix robots was the first such game. Wasn't there an Apple II commercial game that sparked it all off? After that, there were variants everywhere. (There was even an HP3000 version that used a RPN Forth-like language.)
One line blog. I hear that they're called Twitters now.
^H = Backspace
"I told you a million times not to exaggerate!"
Okay.. You only have 9 possible moves. So on each turn, you run through all your possible moves, one at a time. After each move you can make, you calculate what the robots will do (since this is known), and then make a choice.
-If a move will get you killed, you eliminate it as a possibility.
-If all moves will get you killed, you teleport and hope for the best.
The only real choice is when you have more than one move that will keep you alive, and just a few rules can make this fairly obvious on what to do.
-If all the robots are in line with you and there's a scrap pile between them and you, stand your ground. They'll eventually run into the scrap.
-If a move will make robots collide, bump it up in priority a bit. Bump collisions that eliminate robots that are closer to you higher than collisions happening far away.
-If a move will bring robots closer to each other on the same line, bump it up in priority a bit, because this sort of thing will eventually cause them to collide. Give extra priority to bringing together robots that are closer to you, because scrapheaps closer to you protect you from robots further away from you.
-If a move will get you closer to any robots, lower it in priority a bit, because you want to keep your distance when possible. This should be less than the above priority adjustment because to bring robots together you need to have them on opposite sides of you, either vertically or horizontally.
Once you've done that, you pick the move with the highest priority. Then it's just a matter of tweaking these priority adjustments by hand until you find one that works good.
Apples are a null factor. The only way it states to end the game is to kill all the robots, and it says you get all the remaining apples after that anyway. So going after them is pointless with the rules as written. If getting all the apples also ends the game, then that's something else to consider as a factor, and makes it a bit more complicated.
- Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
APD. It's been around for several years (it was hosted elsewhere before being moved to PECL in 2002).
Am I the only one who can't access the site at the moment? I already have a script mostly made thank you google chache) and would like to test it... Would someone mind emailing it to me/mirroring it?
a+b=c 4a-3a+4b-3b=4c-3c 4a+4b-4c=3a+3b-3c 4(a+b-c)=3(a+b-c) 4=3