Bender - Episode 1 - Puzzle discussion


#42

Hahaah even I thought of this too :smiley: But then I realised its not in the spirit of learning so :stuck_out_tongue: ditched the idea


#43

Thanks a lot I never realized there can be more than 1 previous state :sweat_smile:


#44

Okay I was on 83% and the I solved the LOOP validation and now I am stuck on 92%. I cant seem to pass the All together validation case.It passes the testcase but not the validation.


#45

I use Python 3. My program does not pass the second test, why this result wrong? Third test (‘Priorities’), for example, is succesful


#46

Why “west” after “north”?


#47

you go south, then east3, then north, then west3 = you return to starting point!
isn’t this weird?


#48

You misunderstood the puzzle statement. When Bender needs to change direction, he always tries them in the same order whatever his current direction is. So in test 2:

  • he goes south until first wall
  • then he can’t go south so he goes east until second wall
  • then he can go south so he does go south until third wall
  • then as step 2, he goes east until fourth wall
  • and finally he can go south to the target

#49

I seem to be stumped at the last testcase. For some reason, I follow the exact same steps as the expected result, until step 151 where I find the destructible wall at 6,20 is still there (and I’m not in breaker mode) and the expected result walks right through.
If for some reason I ignore the beer at 9,2 all is well, but that’s not the right thing to do :smile:
What am I missing? I have a step-by-step log of everything that happens (http://pastebin.com/WFkyDCXF), but I can’t find a fault in it.
(Coordinates are 0-based)
(Also…might be related, my code fails validation for the last 2 tests after submitting).

Edit: Ok, I figured it out…subtle but still my mistake. I neglected to follow one part of instruction regarding the consumption of beer. “The beers remain in place after Bender has passed.”


#50

Hello,

Really strange I succeed all the tests in the editor but when I submit the test “Simple Move” failed.

Anyone can submit his solution to see if he have the same problem ?
I also valid the two tests given in the subject.

Thanks.


#51

The test cases are only some random samples. Passing them doesn’t mean your algorithm will pass all other possible random samples.

The validation test cases are just another set of random samples. Your algorithm has a bug as long as any test case fails. It might even contain bugs when you pass all validation test cases.


#52

Yes I know that tests may differ from the IDE tests, I checked again my code and read carefully the problem.

But same result, does anyone succeed to get 100% now? Or any idea what I should check?


#53

Check the post by eng_nabilion555. That fixed my Simple Move failure.


#54

Thanks you, the same problem, 100% for the tests!


#55

I’ve done a score of “54%”. The success “50%” was not unlocked ?!?
Then, I’ve done “62%” and the success “50%” is now unlocked :slight_smile:


#56

What was the problem? It’s the only validation I don’t pass (breaker mode).


#57

Somehow I am passing all tests in the validation case and all but the obstacle one when I submit the code.
I have no idea where I am going wrong,

can someone help me?


#58

I have had some troubles with this type of input, maybe it’s helpful for others (Code passed all sample inputs but failed the “Broken Wall?” validator)

5 7
#######
# # # #
##    #
#@BBX$#
#######


#60

I m not sure because long time ago, but i think order between $ test and # test is important… :slight_smile:


#61

Thats it! Thank you, finally have last validation passed and gained 100%!


#62

Hello!
There is a following problem. The program gives output identical code which can be seen through the Test cases-> View. But the test “Multiple loops?” not passed written
"Failure
Found: E
Expected: S "
Why?