Skip to content

Instantly share code, notes, and snippets.

View jplandolt's full-sized avatar

Paul Landolt jplandolt

  • Royal Computer Systems
  • Toronto, Ontario, Canada
  • 08:57 (UTC -05:00)
View GitHub Profile
@coolbutuseless
coolbutuseless / 8-out-of-10-cats.R
Created February 2, 2019 01:14
Solving the numbers puzzle in "8 out of 10 cats does Countdown"
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#' Inner recursive routine for solving Countdown numbers puzzle
#'
#' @param nums What numbers are left to select from?
#' @param value the current calculated value
#' @param expr the current readable expression
#' @param verbose output solutions as they are found? default: FALSE
#'
#' @return Character vector of solutions if any are found, otherwise NULL
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~