Skip to contents

Validate pipe connections, see day 10 - 2023

Usage

validate_connections(env, chr, pos, remove_original = TRUE, k = 1)

Arguments

env

Environment with the current field, x.

chr

Character with current position's element.

pos

Data frame with current position (i, j).

remove_original

Boolean flag to indicate if the current tile should be removed from the original field (i.e., changed to ".").

k

Integer with the number of k nearest neighbours to return.

Value

Matrix with validated connections for the current tile.