Learn R Programming

minesweeper (version 1.0.0)

save_minesweeper_gif: Save a Minesweeper Recording to GIF

Description

Save a recorded game of minesweeper to a GIF file.

Usage

save_minesweeper_gif(
  recording,
  gif_file = "animation.gif",
  width = 800,
  height = 600,
  delay = 1,
  loop = TRUE,
  progress = TRUE,
  ...
)

Value

The file path of the GIF file.

Arguments

recording

object of class "minesweeper_recording" returned by play_minesweeper()

gif_file

output gif file

width

gif width in pixels

height

gif height in pixel

delay

time to show each image in seconds

loop

if the gif should be repeated. Set to FALSE to only play once, or a number to indicate how many times to repeat after the first.

progress

print some verbose status output

...

other graphical parameters passed to png

Details

Reduce the delay for greater temporal resolution.

Examples

Run this code
if (FALSE) { # interactive() && requireNamespace("gifski", quietly = TRUE)
dev.new(noRStudioGD = TRUE)
recording <- play_minesweeper()
save_minesweeper_gif(recording)
dev.off()
}

Run the code above in your browser using DataLab