R/count2str.R

Defines functions count2str

count2str <- function(count) {
  count <- rev(strsplit(as.character(count), "")[[1]])
  if(length(count) > 3) count <- count[1:3]
  counts <- rep("0", 3)
  counts[seq_along(count)] <- count
  rev(counts)
}

Try the minesweeper package in your browser

Any scripts or data that you put into this service are public.

minesweeper documentation built on April 3, 2025, 9:29 p.m.