|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
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
|
|||
|
|||
|
[appleeaters]Robots don't die?
Well, I think this screenshot speaks for itself: http://webselect.dk/error.gif
After that the robot (or robots) just kept getting closer till I died ... I guess that's a bug. Happy chasing Also - regarding the speed of it all ... the maximum matrix is pretty massive with 1000x1000 and several thousand apples and robots. Have you done any worst case scenario testing? It would be a real help if you told everybody how many moves you could expect to make in the worst case scenario even with minimal code ... I have a feeling that unless you have some pretty hefty machines to run it on then it won't be all that many. Frankly it seems kinda stupid for a script that already runs for upwards 60 seconds that you have to be really careful with your coding ... and in a language like PHP. It just seems like a pseudobarrier that people are forced to code up against - it's not about coming up with a brilliant solution to this game but rather trying to stay within the boundries of max runtime. It just doesn't feel right when I'm already considering using an internal counter so I can commit suicide when the time approaches 60 seconds ... |
|
#2
|
|||
|
|||
|
[appleeaters]RE: Robots don't die?
And btw - 5 (stay in place) doesn't seem to be the default.
The command is empty when not calling it with anything - which equates to 0 - which means teleportation. |
|
#3
|
|||
|
|||
|
[appleeaters]RE: Robots don't die?
I agree that the 60 second limitation seems odd for overall script execution.. 60 seconds between moves would be more realistic, also since there is now way to end the game without dying or killing all the robots (which could take hundreds of moves) it makes more sense.. That's kinda what I've been working of using set_time_limit(0) before move() and set_time_limit(60) after (doing the same thing with start() so it doesn't timeout on a huge matrix)
Make more sense if it was part of the library, but ya know |
|
#4
|
|||
|
|||
|
[appleeaters]RE: Robots don't die?
Last post was me.. Really should register..
-- Tresni (tresni AT crackmonkey DOT us) |
|
#5
|
||||||||
|
||||||||
|
[appleeaters]RE: Robots don't die?
I noticed the same problem. Robots didnt always die when they ran into each other or into dead robots. I'm using the PHP that comes standard with redhat9.
Here's my fix to robotslib.php: remove: php Code:
and replace it with: php Code:
haven't tested extensively, but this seemed to fix the problems i could see. Dan Sturtevant |
|
#6
|
|||
|
|||
|
[appleeaters]RE: Robots don't die?
Example of robot not dying:
http://jeff321.com/projects/robots/1.jpg light blue = player, Green = apple, red = robot, dark red = dead robot http://jeff321.com/projects/robots/2.jpg Robot lands on the dead robot, and I'm going to eat the apple... http://jeff321.com/projects/robots/3.jpg Status showing apple eaten but robot still alive http://jeff321.com/projects/robots/4.jpg Robot went right through dead robot. |
|
#7
|
|||
|
|||
|
[appleeaters]RE: Robots don't die?
Jeff, run your script on the latest robotslib.php and tell me if you have the same problem with robots not dying.
|
|
#8
|
|||
|
|||
|
[appleeaters]RE: Robots don't die?
The new lib, proparlly kills robots for me. Infact now that the robots die my script is undeafted in my small game (width/height <200) test cases now to work on the lame movement optimizations and other silliness :/.
|
|
#9
|
|||
|
|||
|
[appleeaters]RE: Robots don't die?
I think it's good now but if I notice anything odd I'll let you know.
|
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > [appleeaters]Robots don't die? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|