pick_sl: Pick Super Lotto numbers

View source: R/pick_sl.R

pick_slR Documentation

Pick Super Lotto numbers

Description

Pick Super Lotto numbers

Usage

pick_sl(size = 1L, verbose = TRUE)

Arguments

size

An integer. The size of sets of Super Lotto numbers to pick.

verbose

A logical value. Print the numbers picked or not.

Value

Print the numbers picked, and return the invisible balls list that stored these numbers.

Examples

# Example 1
pick_sl(10)
# Example 2
out <- pick_sl(10, verbose = FALSE)
out
# Example 3
# create an empty list
balls <- list(c(front = rep(NA, 5),
                back = rep(NA, 2))
)
luck <- list(c(front = c(10L, 13L, 14L, 19L, 27L),
               back = c(6L, 10L)))
# limit the max number of draws
max <- 9999
# try
# count the number of draws
i <- 0
while (!identical(balls, luck, max)) {
  i = i + 1
  balls = pick_sl(verbose = FALSE)
  if (identical(balls, luck)) {
    print(i)
    print(balls)
  }
  else
    if (i == max) {
      cat(i, "failed\n")
      break}
}

Keng documentation built on Sept. 1, 2026, 5:07 p.m.