Package 'prithulib'

Title: Perform Random Experiments
Description: Enables user to perform the following: 1. Roll 'n' number of die/dice (roll()). 2. Toss 'n' number of coin(s) (toss()). 3. Play the game of Rock, Paper, Scissors. 4. Choose 'n' number of card(s) from a pack of 52 playing cards (Joker optional).
Authors: Prithul Chaturvedi <[email protected]>
Maintainer: Prithul Chaturvedi <[email protected]>
License: GPL
Version: 1.0.2
Built: 2025-02-13 03:25:24 UTC
Source: https://github.com/cran/prithulib

Help Index


Choosing a card

Description

An event of choosing a card from a pack of 52 cards (Joker optional)

Usage

cards(n, joker = FALSE)

Arguments

n

is the number of cards to be chosen (default 1)

joker

TRUE includes the Joker card in the deck (default FALSE)

Value

The chosen card(s)

Author(s)

Prithul Chaturvedi

Examples

cards(3, joker = TRUE)

Rolling an unbiased die

Description

Rolls a die for 'n' number of times

Usage

roll(n = 1, size = 6)

Arguments

n

is the number of times to roll the die (default 1)

size

is the number of faces on the die (default 6)

Value

Outcome(s) of rolling of the die

Author(s)

Prithul Chaturvedi

Examples

roll(2,10)

Rock, Paper, Scissors

Description

Play Rock, Paper, Scissors

Usage

rpc()

Value

A move

Author(s)

Prithul Chaturvedi

Examples

rpc()

Tossing an unbiased coin

Description

Tosses a coin for 'n' number of times

Usage

toss(n = 1)

Arguments

n

is the number of times the coin is tossed (default 1)

Value

Outcome(s) of tossing the coin

Author(s)

Prithul Chaturvedi

Examples

toss(3)