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.
This link demonstrates the state of the bombs after each second. Run the sample test cases here and observe the pattern different values of n.
For even n, the grid will always be filled with bombs.
For n % 4 == 3 case, we have to plant bombs in empty space and explode the already present bomb once(second parameter of my function is 1 in this case.)
For n % 4 == 1 excluding 1 cases, we have to plant bombs in empty space and explode the already present bomb twice(second parameter of my function is 2 in this case.)
The Bomberman Game
You are viewing a single comment's thread. Return to all comments →
https://jsfiddle.net/y140brhc/
This link demonstrates the state of the bombs after each second. Run the sample test cases here and observe the pattern different values of n.
For even n, the grid will always be filled with bombs.
For n % 4 == 3 case, we have to plant bombs in empty space and explode the already present bomb once(second parameter of my function is 1 in this case.)
For n % 4 == 1 excluding 1 cases, we have to plant bombs in empty space and explode the already present bomb twice(second parameter of my function is 2 in this case.)
For n = 1 case, we just need to print the input.