[Community Puzzle] We're going in circles!

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @BartholomewIII,validated by @Adam798,@Chomb and @UnnamedCodinGamer.
If you have any issues, feel free to ping them.

I have 100% in my tests and 57% in my validators -_-’

If I find my bug, I will try to find a validator for it.

1 Like

I had same problem. Watch out for dots ‘.’ because multiple different loops can cross same dot. Focus on marking only visited ‘<>v^’.

If your program passed all the tests (including “overlapping loops”) but not all of the validators, I’m a little confused. Perhaps it’s a time-out issue? Double check that you don’t have any conditions that would loop infinitely.

1 Like

I fail at validators 2, 3 and 7.

I think I correctly managed the dots, but I will check.

Edit : OK now I pass all tests and all validators. Not completely sure what code modification did the trick, but there was definitely something strange about how I managed the dots.

Nice!

If you figure out exactly what code passes all the tests but not all of the validators, please DM me and I’ll see if I could add/modify the tests to make sure that doesn’t happen. (then again, I don’t know if I’m able to do that)

1 Like

Hey there

I share the same situation with @Yatagan : all tests OK but only 57% on validators (2,3, 7 as well).
Obviously, no hard-coded solution :grin:

Rather difficult to understand what’s wrong without validators…

i have the same issue as as everyone,

All my tests are OK but only 57% on validators (2,3, 7 as well).
No hard-coded solution of course.
Using C#

I think the test cases miss a situation when there are multiple “entries” into a single loop. Also a question doesn’t mention anything about such a situation. I assume it’s a valid loop, an example

>.>.v
>.^..
>.^..
>.^.<

I assume an expected answer is 1

Yes it is.

Had the same issue as previous authors - tests 2, 3 and 7 are failing and only 57% score.

My mistake was: marking as visited all cells in a grid which I visited, not only cells with arrows…

The following test shows my mistake:

Input:

3 2
>.v
.^<

Output: should be 0.

Here I marked cell (row=0, column=0, value=’>’) as visited, then cell (row=0, column=1, value=’.’) as visited (mistake!), then cell (row=0, column=2, value=‘v’), then cell (row=1, column=2, value=’<’), then cell (row=1, column=1, value=’^’). Now my program arrives at cell (row=0, column=1, value=’.’), which was marked as visited, and decides that this path forms a loop, which was not correct.

But if you do not mark empty cells as visited, there should be no problems like this one…

2 Likes

The sixth test case should cover that situation (“Multiple inputs”).

1 Like

It’s a bit unfortunate that people are struggling with validators after passing all the tests ): I hope that people having difficulties can get some ideas after perusing through this thread.

When a validator is causing too many failure and frustration, an effective help is to open the validator to become a new test case, and create similar new cases to fill up the validators.

2 Likes

I’d be willing to do that. How do you make changes? (I looked before and could not see an edit button)

We have to move them around manually.

Just like how you were editing your contribution before getting approved, in your Edit mode, copy your validator data to create a new test case.
The original validator and the new case validator should have new data to paste in.

1 Like

The overlapping loops test will fail if you mark the dots on the field, so this shouldn’t be the issue.

i had a time out issue, it was looping indefintely on the last 2 tests. i added a time out counter and now i have 100% for the real submission :slight_smile:

1 Like

thanks :grinning_face_with_smiling_eyes:
your test case has put the focus on my mistake so that I could fix it and reached 100%

In my code, the fix consists in adding a condition when evaluating the last point closing the loop:
first condition: the point is already in “beginning path” of the loop ==> 57% of validators
second condition: the point is not “.” (dot) ==> 100% of validators

thank you all :stuck_out_tongue_winking_eye:

@horus71 @Makblack I moved validators 2 and 7 into their own tests and that should hopefully help you figure it out.

1 Like