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
- Discussions
The Bomberman Game
The Bomberman Game
Sort by
recency
|
36 Discussions
|
Please Login in order to post a comment
Observation: There is a pattern: --> The blast at 3rd second, 7th second, 11th second.... will be the same. --> Similarly, the blast at 5th second, 9th second, ... and so on will be the same. What we can do is to create a function that gets us the output grid for the 3rd second (1st blast). Now if we run that function again with the input of the 1st blast, we will get the output for the 5th second (2nd blast)
My code:
What I am doing is using a flag variable to check the seconds.
`
Python3 short but horrible:
C#:
Python - uses a nice 'discard this bomb location if it exists' set operation so you can 'explode' the five bomb squares without worrying about bound checking.
Classic HR 'hope you know this trick about the problem' feature where you have to know that the solution will bounce between two states in a stable pattern ... else trying to solve it by performing all the steps takes too long for the test cases and hits timeouts.
Python. Runs the clock and does explosions until a cycle is found. For explosion steps, grid for each t % 2 == 1 is kept in the memory. Once the cycle is found, number of steps to make through the graph is calculated, as well as the cycle length and with that final_t can be calculated.