[Community Puzzle] \ Domino Puzzle /

Feel free to send your feedback or ask some help here!

How is it possible that more than four dominoes fall in the β€œsimple” test case?
| | | /
\ | | \
- | | -
- | . -
The three dominoes on top left fall, then the one on the top right and it stops.

The one on the top right falls on the one below.

1 Like

Ha, I thought that such a move was impossible.

I pass everything but the last validator after submit. my dominoes fall in order, I’m not so certain that order doesn’t matter. What trickery is involved in the last validator? I’ve accounted for the first space being empty, so that shouldn’t be it. I guess it could be timing out, but i doubt it - it’s not that complex. I’m basically just doing a flood fill, with a stack . No fancy classes. I even use an array instead of a bunch of if statements eg. $dirs=[β€˜LEFT’ =>[’|’=>true ,’-’=>false,’\’=>true ,’/’=>true ],
β€˜RIGHT’=>[’|’=>true ,’-’=>false,’\’=>true ,’/’=>true ],
β€˜TOP’ =>[’|’=>false,’-’=>true ,’\’=>true ,’/’=>true ],
β€˜BOT’ =>[’|’=>false,’-’=>true ,’\’=>true ,’/’=>true ],
β€˜TL’ =>[’|’=>true ,’-’=>true ,’\’=>false,’/’=>true ],
β€˜TR’ =>[’|’=>true ,’-’=>true ,’\’=>true ,’/’=>false],
β€˜BL’ =>[’|’=>true ,’-’=>true ,’\’=>true ,’/’=>false],
β€˜BR’ =>[’|’=>true ,’-’=>true ,’\’=>false,’/’=>true ]];
Yes, I’m using php. Help?

Hi there,
I am not sure that order matters - I tried it using DFS instead of BFS (my original solution) and there is no difference.
As for the last validator, I don’t think there is anything particular about it.
I hope this helps.

Having the same problem as Patrick above. Pass all tests and validators except the last one. I’ve tested a bunch of edge cases in the IDE, coded an empty starting space, tried hard coding 0, NN, NN-1 as the answer, none of this can get me past the last validator. Any hint would be much appreciated.

1 Like

cc @PatrickMcGinnisII

Here’s the validator:
Input

4

- . . .
 \ | | /
 - - . -
 / | | \

Output

1

3 Likes

Sorry, I missed to mention it on the forum.
@LastRick struggled with validator 5. He found the bug and provided an additional testcase (causing an infinite loop for the buggy solution) which I added to the end.

2 Likes

perfect, thanks!

1 Like

Hello, in my case all the tests work, and all the validators too,exept the first one…And i have no idea why; Can someone help me?

Try a Custom test case:

4
| / | /
. . \ -
. | . \
. | | \

Expected output:

2

To run Custom test cases you need to enable Expert mode is settings.

1 Like

You’re right, I also think of that…