sliding.puzzle: Sliding puzzle in R

Description Usage Arguments Details Author(s) References Examples

View source: R/sliding.puzzle.r

Description

Use R to play sliding puzzle (currently only the Windows screen display).

Usage

1
sliding.puzzle(size = NULL, bg = "lightblue", z = NULL)

Arguments

size

two dimensional vector, the size of sliding puzzle. Note: the element of size must be greater than 1.

bg

the background color of blocks.

z

the matrix of sliding puzzle, if z is specified, size will be omited.

Details

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.

Author(s)

Taiyun Wei

References

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

Examples

1
2
3
4
5
6
## Not run:  
sliding.puzzle(c(3,3))

sliding.puzzle(z=matrix(0:11, 3, 4))

## End(Not run)

fun documentation built on May 2, 2019, 6:06 p.m.