473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Prision Break

kadghar
1,295 Expert 1GB
There is a guy in prision, and he founds a knife and a key (like wolfstein 3d)..

Now, he must get out of prision but before he does he must kill each and every guard.... the building looks like this from above:


_________
|x_|__|__|__|
|__|__|__|__|
|__|__|__|__|
|__|__|__|_e|

The guy is in the first cell (x), in each of the other 15 cells is a guard, the exit is the last cell (e).

The only condition is that (because of religious reasons or whatever) he cannot goes into a cell where he has killed a guard (and each time he enters a cell he kills the guard and leave the body there and the guards cant leave their cell). The doors are vertical and horizontal (not diagonal).

What's the path he must follow to get out?
Jun 20 '07 #1
7 1477
DeMan
1,806 1GB
That's a tough one......
Each solution I've tried always leaves 1.........
Jun 20 '07 #2
Rabbit
12,516 Expert Mod 8TB
There is a guy in prision, and he founds a knife and a key (like wolfstein 3d)..

Now, he must get out of prision but before he does he must kill each and every guard.... the building looks like this from above:


_________
|x_|__|__|__|
|__|__|__|__|
|__|__|__|__|
|__|__|__|_e|

The guy is in the first cell (x), in each of the other 15 cells is a guard, the exit is the last cell (e).

The only condition is that (because of religious reasons or whatever) he cannot goes into a cell where he has killed a guard (and each time he enters a cell he kills the guard and leave the body there and the guards cant leave their cell). The doors are vertical and horizontal (not diagonal).

What's the path he must follow to get out?
There's no guard in his original cell so he goes back into that one.
_________
|x2|3_|4_|5_|
|1_|8_|7_|6_|
|10|9_|14|15|
|11|12|13|_e|
Jun 20 '07 #3
DeMan
1,806 1GB
I convinced myself that would do him no good because one of the adjoining ones would have a body......
I never thouoght of returning after the first kill!!

Well Done!!
Jun 20 '07 #4
Rabbit
12,516 Expert Mod 8TB
I convinced myself that would do him no good because one of the adjoining ones would have a body......
I never thouoght of returning after the first kill!!

Well Done!!
I almost did that. It's easy enough to eliminate any simple path or any convoluted zigzag path so that only left returning to the original cell, just a question of when.
Jun 20 '07 #5
kadghar
1,295 Expert 1GB
I almost did that. It's easy enough to eliminate any simple path or any convoluted zigzag path so that only left returning to the original cell, just a question of when.
Yeah!!! well done Rabbit, i never tought someone will come with the answer that fast.
Jun 20 '07 #6
DeMan
1,806 1GB
Never safe to post puzzles while rabbit's around......they don't last long
Jun 20 '07 #7
Rabbit
12,516 Expert Mod 8TB
Never safe to post puzzles while rabbit's around......they don't last long
Depends on the type of puzzles. My english vocabulary isn't that strong. This one took me maybe 5 minutes to solve but only because there's obviously a trick answer and the trick is pretty transparent if you're looking for it.
Jun 21 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Martin Lucas-Smith | last post by:
Is there any need to keep the final break in a switch which uses a default at the end? I.e: switch ($data) { case 'foo': # Action break;
5
by: Ann | last post by:
I have trouble sometimes figuring out where break and continue go to. Is there some easy way to figure it out, or a tool? TIA Ann
1
by: Scanner2001 | last post by:
I am trying to insert a printer page break inside of a form. I do not seem to be able to do this. My form contains 3 asp panels. Each of the panels have dynamically built content, and they are...
5
by: viza | last post by:
Hi! Suppose I have int i,j,k; for(i=0;i<I;++i){ /* loop 1 */ for(j=0;j<J;++j){ /* loop 2 */ for(k=0;k<K;++k){ /* loop 3 */ if(test){
25
by: chunhui_true | last post by:
In <<expert c>>I know the break in if wich is scoped in switch is break the switch,like: switch c case 1: if(b){ break; } ...... But like this: while(a){
2
by: yyhhjj | last post by:
I created a test program to implement an iterator. First, I used 'yield break' in the iterator, it worked normally. Then, I simply used 'break' in the places of 'yield break', it still worked...
3
by: Barbara Alderton | last post by:
I recently wrote an ASP.NET app that used user controls. I produced a printer-friendly output form. One requirement was a pagebreak between one part of the form and another. I had no problem...
26
by: Alexander Korsunsky | last post by:
Hi! I have some code that looks similar to this: -------------------------------------------- char array = "abcdefghij"; for (int i = 0; i < 10; i++) {
7
by: =?Utf-8?B?aXdlYg==?= | last post by:
Can we set page breaks in ASP Pages dynamically based on the data being populated? Akshay.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.