board: board

Description Usage Arguments Value Examples

View source: R/board.R

Description

board

Usage

1
board(mat = NULL, n = 5, p = 0.25)

Arguments

mat

takes matrix default NULL

n

defines size of matrix when mat is NULL

p

a number between 0 and 1 that denotes the fraction of the 'n^2' squares are blocked

Value

board class objects, if given matrix is incorrect, it returns error

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
board
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    0    1    1    1
[2,]    1    0    1    1    1
[3,]    0    1    1    1    1
[4,]    1    0    0    1    1
[5,]    1    1    0    1    1
attr(,"class")
[1] "matrix" "board"
attr(,"n")
[1] 5
attr(,"p")
[1] 0.25

sthkindacrazy/percolate documentation built on Nov. 5, 2019, 9:38 a.m.