Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When you call the time function, it will cut off the simulation once that 1/100th of a second limit is reached, no matter what happens inside the simulation. So even if your opponent simulates you or performs some expensive computation or even goes into an infinite loop, time will terminate in the allotted number of seconds plus the overhead. If that happens, though, it will return Nothing, so you won't have gained any information about what your opponent will do.


I mean that it doesn't seem a safe upper bound - `time` will return, but there are situations where to get a useful result, you need to increase the limit; and it's easy to get in those situations even when neither bot is running lots of repeated simulations.

This class of difficulty can't be completely eliminated, but it seems that being able to run bots for a long time relative to the overhead of `time` would reduce it.


Ah, I see what you mean now. This was deliberate--I want simulation time to be a precious resource that bots have to spend wisely. You can burn 4 seconds on one simulation that is more likely to give you valuable information, but then it's the only one you're going to get. Or you can do lots of small simulations that are less likely to return an answer. I agree that it's not very safe, which is somewhat unfortunate, but also serves to discourage bots that use precise timing as part of a strategy. Also, since timing out results in a defection rather than in some additional penalty, the risk isn't too large.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: