Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @VictoriousTriceraton,validated by @BleedingWithin and @Westicles.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @VictoriousTriceraton,validated by @BleedingWithin and @Westicles.
If you have any issues, feel free to ping them.
Sure of the āReal Madnessā Validator ? I have no āhard-codeā and pass all other tests and other validatorsā¦
Fun Puzzle
The second character from the head cannot be āoā. In other words snake is always of length 3 or more. Without this condition Validator 5th fails, even if 5th Test passes.
Also check that your code moves from o to | only if itās over/under and from o to - only if itās on its right/left.
Right. And how can a snake have another head right after its head? The snake has only 1 head
And based on the rules at the end of the problems of the statement - the minimum possible size can be 3.
Sure, I start with āoā and my code check only ā-ā or ā|ā next.
And I check independantly vertical and horizontal cases. After āoā is ā-ā only if "o"row == "-"row
My solution counts the size of each snake while removing them from the drawing. On that test, I get a blank field with dots ā.ā at the end. So yes, sure =)
Mine stocks snakesās history in an array and check if the cell Iām on is an other snakeā¦
Maybe I should use yours to see if itās make a differenceā¦
There can also be a problem with the size of the execution stack if you do it recursively but there are longer snakes in other validators so it would fail in other validators too.
Yes =) That is why this problem donāt have tag ārecursionā. But someone use sys.setrecursionlimit(6400) (in python3) to get 100% with Recursive Algorithm =)
6400 - because 80x80 - max possible size of grid.
Where is said in statement that snake cannot be of size 2? For example āo>ā
In previous post, i meant second character from the tail cannot be āoā (if somene starts with tail), Sorry.
In tests and validators you wonāt see:
"o>"
"<o"
"^
o"
or
"o
v"
If your solution deal with such 2-length snakes it will be aslo 100% in puzzle. You get wrong - because you count, for example "o<"
as snakeā¦ but this can be a fish, not a snake
This is why i didnāt make such snakes in test cases. You can tell visually that a lot of the combinations wouldnāt be valid.
Snake head next to a tail that points at the head. This canāt be a snake of size 2 because the tail points in the wrong direction, so itās either two separate snakes, or a snake facing its own tail.
Example: āo<ā is not a valid snake, but ā<-o<-oā is two valid snakes.
Snake head next to a tail that points sideways. This canāt be a snake of size 2, because a turn in the snake requires a ā*ā character. Similarly to the first case itās could either be two distinct snakes, or a snake touching its tail.
Example: āovā is not a valid snake but the following is two valid snakes
"...o"
"...|"
"<-ov"
For those who canāt pass the 5th validator, your solution is probably not fast enough. The last validator has over 400 snakes, and their sizes vary from 3 to [the answer to the problem :-)]
I donāt think so, according to the statement.
It doesnāt matter if you count such cases as a two-character snake or not. in tests you will not encounter such a situation, and therefore you will not get an error during validation.
Yes, and we are both right.
That was a size problem.
My code was checking if a cell had been seen in an other snake to eliminate it. I though win timeā¦
But I wasnāt
Hey everyone!
I have some trouble with the āReal Madnessā validator, I guess my code isnāt fast enough
is āoā<ā a snake ?
and āo----^ā