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.
The Bomberman Game
The Bomberman Game
Sort by
recency
|
366 Discussions
|
Please Login in order to post a comment
N(nothing) only happens at 2 seconds. After that bombs are detonating or you are planting bombs.
P0->N->P1->D0->P2->D1->P3->D2->P4->D3->....etc
The question tells you this indirectly as the "nothing" is step 2, and we are told to repeat step 3 and 4. Insulation types for hot climates
Instructions: Here are some helpful tips:
Convert the list into a 2D matrix of integers. Assign state codes to each cell. Use pen and paper: Start by defining an initial state for the matrix (e.g., a 3x3 grid for simplicity). Write down the matrix for each second, step by step, until you observe a repeating pattern or a cycle.
Optimization Tips:
Handle edge cases efficiently:
Quickly return results for trivial cases or repeating sequences.
Focus on patterns:
Once you identify a repeating pattern, determine if you need to calculate the states for all seconds individually.
Simplify your approach:
Assess whether storing the state codes as integers is necessary for solving the problem.
My solution:
def bomberMan(n, grid): if n% 2 == 0: return ["O"*len(grid[0])]*len(grid)
swift: