You are viewing a single comment's thread. Return to all comments →
💡 Either player could just reduce a tower’s height to 1 as the most optimal move. However, Player 1 always moves first so there’s two implications:
If the default tower height > 1:
P1 will always have the last optimal move if there's odd number of towers
P1 → P2 → P1(WIN)
Otherwise, P2 wins.
P1 → P2 → P1 → P2(WIN)
So, basically the player who has the last optimal move wins
Java:
public static int towerBreakers(int n, int m) { return (n % 2 == 0 || m == 1) ? 2 : 1; }
Seems like cookies are disabled on this browser, please enable them to open this website
Tower Breakers
You are viewing a single comment's thread. Return to all comments →
💡 Either player could just reduce a tower’s height to 1 as the most optimal move. However, Player 1 always moves first so there’s two implications:
If the default tower height > 1:
P1 will always have the last optimal move if there's odd number of towers
Otherwise, P2 wins.
So, basically the player who has the last optimal move wins
Java: