Description Usage Arguments Value Examples
percolate.board
1 2 | ## S3 method for class 'board'
percolate(start_board)
|
start_board |
board(matrix) of initial stage |
list of result_board(after the percolate end), and result whether it is percolate or not
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | mat_example_list <- list(matrix(c(1,1,1,1,0,
0,0,0,1,0,
1,1,1,1,0,
0,1,0,0,0,
0,1,1,1,1), 5, 5),
matrix(c(1,1,1,1,0,
0,0,0,1,0,
0,1,1,1,0,
0,1,0,0,0,
0,1,1,1,1), 5, 5),
matrix(c(1,1,1,1,0,
0,0,0,1,0,
0,1,1,0,0,
0,1,1,1,1), 5, 5))
## turn matrices to board
example_boards <- lapply(mat_example_list, board)
## apply boards to percolate.board
laply(example_boards, percolate.board)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.