maze2binary: Convert maze to binary matrix

View source: R/helper_functions.R

maze2binaryR Documentation

Convert maze to binary matrix

Description

A function to convert a maze object into a binary matrix. This can be useful for visualization (as when plotting the walls of the maze) and for constructing complex mazes, such as a maze-within-a-maze.

Usage

maze2binary(m)

Arguments

m

A maze object.

Value

A binary matrix where values of 1 denote paths through the maze and values of 0 denote the walls (impassable regions) of the maze.

Examples

m <- maze(10,10)
m2 <- maze2binary(m)


kstreet13/mazing documentation built on May 12, 2024, 10:32 a.m.