Skip to contents

Count Black Pixels in Grid

Usage

count_black_pixels(grid)

Arguments

grid

Numeric matrix. The simulation grid.

Value

Integer. Number of black pixels.

Examples

grid <- initialize_grid(10)
#> INFO [2026-02-03 16:36:03] Initializing grid of size 10x10
count_black_pixels(grid)  # 1 (only center)
#> [1] 1