Implement an elementary cellular automata step function for a 2D grid of size using a von Neumann neighborhood.
The von Neumann neighborhood of a cell consists of the cell itself and its 4 orthogonal neighbors: (above), (below), (left), and (right).
Given input grid A, compute output grid B by applying your own custom function to each cell's von Neumann neighborhood:
Design to create the most visually interesting simulation possible!
Input
A: Input grid of integers of sizen: Number of rowsm: Number of columns
Output
B: Output grid of integers of size
Notes
Use zero-flux (Neumann) boundary conditions at all edges:
- At (first row): treat
- At (last row): treat
- At (first column): treat
- At (last column): treat
Loading...
Loading editor...
CUDA C++ environment
Desktop Required for Code Submission
For the best coding experience, please switch to a desktop device to write and submit your solution.