Java Puzzle 3: Car
Mar 01, 2012This java puzzle comes in two parts. You have to solve this part to see the next one.
To warm up the engine, we start with the easiest one. Part two will be harder.
This car crashes if you accelerate too much. But can you make it go ten times faster than its limit?
As a driver, do what needs to be done to push the car over its limit. Anything in your code is allowed; any trick outside the code is not. You must run with -Djava.security.manager
, so setAccessible
won't work. If in doubt, read the exact rules.
If you've found the solution, post it into the ugly form over there. There it will be compiled and ran, and if it works, you will be directed to part two. When you've solved it, take a look at part 2.
To be notified of when the solution and next puzzles come out, follow the rss feed or twitter.
4 comments
The submission form doesn’t work for me I think. All I get is this:
Execution id car1-120301-222509-25954-89.76.105.59 Please wait… … Done. Output: Compilation successful. Starting program.
And I wait and wait (I know this is Java so patience might be needed) and nothing happens.
Oh well, I was expecting some more messages from the system, like: program finished, failed, or something. But I see there’s just the output there (empty for that run). So never mind.
I just added a “Program ended.” message. There’s also a line below to indicate that’s the end, but that was a bit too subtle.
Should the solution always succeed (ie be deterministic)?
It doesn’t need a 100% guarantee of working every time. The more reliable, the better. There’s no strict line of what is and isn’t reliable enough.
There is a solution that always seems to work in practice (as far as I know, tested on multiple systems), and does not take any significant time to execute. So that should be your goal.
Do these puzzles still work? I’m getting an error when trying to submit my (extremely simple) solution.
The error is “The page you were looking for doesn’t exist.”
The host running that site that executes the code for you has recently gone down. I’m not going to bother bringing it up again. I just edited the post to reflect that. Thanks for letting me know.
NVM, just saw that I could get to part 2 w/o submitting