lights_out | R Documentation |
By default, the white squares in the plot denote the lights that are on, and black ones for the off. When you click on a light, this light as well as the four neighbors will switch theirs status. Your mission is to close all the lights.
lights_out( width = 5, height = 5, steps = 3, cheat = FALSE, col.off = "black", col.on = "white", col.frame = "lightblue", seed = NULL )
width |
number of lights in x axis |
height |
number of lights in y axis |
steps |
number of “seed” lights to initialize the puzzle. In general,
the larger |
cheat |
logical. If |
col.off |
color when lights off |
col.on |
color when lights on |
col.frame |
color of lights border |
seed |
seed for random number generator |
Linux/Mac users have to use X11(type = 'Xlib')
or the Cairo
graphics device Cairo()
in the package cairoDevice.
Yixuan Qiu yixuan.qiu@cos.name
https://en.wikipedia.org/wiki/Lights_Out_(game)
## should use Xlib for the x11() device under *nix, e.g if (interactive()) { if (.Platform$OS.type == "windows") x11() else x11(type = "Xlib") lights_out() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.