generate_board_mat: Board Generation

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Randomly generate a legal, dry board per inputted instructions.

Usage

1
generate_board_mat(n = 5, p = 0.25)

Arguments

n

A positive integer denoting the dimension of the square board.

p

A float between 0 to 1 that denotes the fraction of the n^2 squares are blocked

Value

The n-by-n board matrix with floor(p*n^2) blocked squares

Examples

1
generate_board_mat(n = 8, p = 0.75)

lilinhonglexie/percolate documentation built on Nov. 4, 2019, 4:32 p.m.