Description Usage Arguments Details Author(s) References Examples
View source: R/sliding.puzzle.r
Use R to play sliding puzzle (currently only the Windows screen display).
1 | sliding.puzzle(size = NULL, bg = "lightblue", z = NULL)
|
size |
two dimensional vector, the size of sliding puzzle. Note: the element of |
bg |
the background color of blocks. |
z |
the matrix of sliding puzzle, if z is specified, |
If size
is specified and z
is NULL
, then the function will generate a solvable sliding puzzle. In addition, the function only works under the Windows screen display because of the limitation of function getGraphicsEvent
.
Taiyun Wei
About the sliding puzzle: http://en.wikipedia.org/wiki/Sliding_puzzle
How to Solve a Slider Puzzle: http://www.justadventure.com/articles/Slider/Slider.shtm
1 2 3 4 5 6 | ## Not run:
sliding.puzzle(c(3,3))
sliding.puzzle(z=matrix(0:11, 3, 4))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.