Skip to contents

Test whether a card is a trump

Usage

sk_is_trump(x, game_type, call = rlang::caller_env())

Arguments

x

An sk_card object or character vector of card codes.

game_type

A single game-type string, one of sk_game_types().

call

The calling environment, used for error reporting.

Value

A logical vector, the same length as x. In "null" games this is always FALSE, because null games have no trumps.

See also

sk_effective_suit(), which folds this into the follow-suit rule.

Other game-type functions: sk_card_order(), sk_effective_suit(), sk_game_types(), sk_strength()

Examples

sk_is_trump(c("CJ", "DA", "HK"), "hearts")
#> [1]  TRUE FALSE  TRUE
sk_is_trump(c("CJ", "DA", "HK"), "null")
#> [1] FALSE FALSE FALSE