diff --git a/DESCRIPTION b/DESCRIPTION index ce8ff3c..8a5ec28 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: bismer Type: Package Title: Shakespearean Insult Generator -Version: 0.1.0 +Version: 0.1.1 Date: 2017-03-24 Author: Bob Rudis (bob@rud.is) Maintainer: Bob Rudis diff --git a/R/bismer.r b/R/bismer.r index 5a8c689..43c65f3 100644 --- a/R/bismer.r +++ b/R/bismer.r @@ -32,9 +32,13 @@ structure(list(c1 = c("artless", "bawdy", "beslubbering", "bootless", "c2", "c3")) -> insults #' Generate a random Shakespearean insult +#' +#' @md +#' @param thou if `TRUE` then the insults are prefixed with "thou" #' @export -insult <- function() { - sprintf("%s %s %s", +insult <- function(thou=TRUE) { + sprintf("%s%s %s %s", + if (thou) "thou " else "", insults$c1[sample(length(insults$c1), 1)], insults$c2[sample(length(insults$c2), 1)], insults$c3[sample(length(insults$c3), 1)]) diff --git a/README.Rmd b/README.Rmd index c686bb5..b1dde73 100644 --- a/README.Rmd +++ b/README.Rmd @@ -4,6 +4,8 @@ output: rmarkdown::github_document `bismer` : Generate Shakespearean insults +Inspired by Dr. Vicky Forster (@vickyyyf) : + The following functions are implemented: - `insult`: Generate a Shakespearean insult @@ -27,6 +29,8 @@ library(bismer) packageVersion("bismer") purrr::walk(1:10, ~print(insult())) + +purrr::walk(1:10, ~print(insult(thou=FALSE))) ``` ### Test Results diff --git a/README.md b/README.md index 021c4a8..2f88ea7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ `bismer` : Generate Shakespearean insults +Inspired by Dr. Vicky Forster (@vickyyyf) : + The following functions are implemented: - `insult`: Generate a Shakespearean insult @@ -20,22 +22,37 @@ library(bismer) packageVersion("bismer") ``` - ## [1] '0.1.0' + ## [1] '0.1.1' ``` r purrr::walk(1:10, ~print(insult())) ``` - ## [1] "venomed beetle-headed death-token" - ## [1] "impertinent clapper-clawed mumble-news" - ## [1] "lumpish tardy-gaited hugger-mugger" - ## [1] "mangled fool-born whey-face" - ## [1] "beslubbering reeling-ripe ratsbane" - ## [1] "mangled tickle-brained foot-licker" - ## [1] "puking dismal-dreaning strumpet" - ## [1] "dankish half-faced pumpion" - ## [1] "puny pox-marked clotpole" - ## [1] "yeasty dismal-dreaning vassal" + ## [1] "thou infectious beef-witted ooxoomb" + ## [1] "thou puking tardy-gaited lewdster" + ## [1] "thou qualling guts-griping foot-licker" + ## [1] "thou venomed doghearted vassal" + ## [1] "thou churlish ill-breeding foot-licker" + ## [1] "thou craven clay-brained skainsmate" + ## [1] "thou clouted full-gorged mumble-news" + ## [1] "thou paunchy doghearted mammet" + ## [1] "thou venomed dizzy-eyed malt-worm" + ## [1] "thou roguish rough-hewn boar-pig" + +``` r +purrr::walk(1:10, ~print(insult(thou=FALSE))) +``` + + ## [1] "craven reeling-ripe gudgeon" + ## [1] "impertinent milk-livered moldwarp" + ## [1] "paunchy guts-griping moldwarp" + ## [1] "spleeny guts-griping death-token" + ## [1] "mangled fly-bitten bum-bailey" + ## [1] "droning tickle-brained haggard" + ## [1] "mangled clay-brained pignut" + ## [1] "frothy pottle-deep horn-beast" + ## [1] "fawning rump-fed scut" + ## [1] "reeky hasty-witted haggard" ### Test Results @@ -46,7 +63,7 @@ library(testthat) date() ``` - ## [1] "Sat Mar 25 22:17:57 2017" + ## [1] "Sun Mar 26 12:52:57 2017" ``` r test_dir("tests/") diff --git a/man/insult.Rd b/man/insult.Rd index 7b08b61..56cf850 100644 --- a/man/insult.Rd +++ b/man/insult.Rd @@ -4,7 +4,10 @@ \alias{insult} \title{Generate a random Shakespearean insult} \usage{ -insult() +insult(thou = TRUE) +} +\arguments{ +\item{thou}{if \code{TRUE} then the insults are prefixed with "thou"} } \description{ Generate a random Shakespearean insult