We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Tower Breakers
- Discussions
Tower Breakers
Tower Breakers
Sort by
recency
|
373 Discussions
|
Please Login in order to post a comment
js single line solution (also to make it a little more fun, chose to do it with no if statements):
I agree that the question, as is tradition on this site, is very poorly written and clearly not by someone that speaks english natively.
The correct answer is not found in the Editorial, but is instead described pretty well on this SO answer.
In short, 'optimal' does boil down to mirroring, because in the case that the next player does not mirror, the first can also avoid mirroring to force the same end result by bringing the invariant back into line with their victory. Look into nim games if that is not clear.
The fact that this is ignored in the Editorial doesn't help the appearance of 'optimal' being an asinine definition of 'well just mirror because you can therefore its optimal'.
Without knowing about nim games or just brute forcing a big truth table, this is not an easy question and is a pretty poor way to gauge understanding. Probably why it's tagged 'observation', they want you to just guess the correct answer based on simulating a few cases.
one thing i noticed that if number of towers i.e., n are even then player 2 will always win.
"optimal" really ought to mean that each player will do whatever is necessary to try and win the game themselves... in which case player 2 would often not match the move of player 1, and would thus break the symmetry rules of these simple answers.
WTF is an 'optimal move'? Because of 'goobledydook' player1 makes move X. WTF....