Skip to contents

This package provides a simple implementation of a Blackjack game with functionalities for card dealing, scoring, splitting hands, doubling down, insurance betting, and more. It allows players to interactively play a round of Blackjack with multiple players.

๐Ÿ›  Installation

You can install the package from GitHub by using devtools:

# Install devtools if not already installed
install.packages("devtools")

# Install Blackjack from GitHub
library(devtools)

devtools::install_github("MonashARP/game-package-wallabies")

โœจ Features

๐ŸŽฎ Interactive multi-player gameplay

๐Ÿƒ Configurable number of decks

โœ… Official Blackjack rules:

  • Surrender

  • Double Down

  • Insurance

  • Split Hands

๐ŸŽฏ Accurate hand scoring

๐Ÿคต Dealer follows house logic

๐Ÿ End-of-round results and outcome summary

๐Ÿš€ Getting Started

Hereโ€™s a quick example of how to start a Blackjack game interactively:

library(Blackjack)

# Start a full round of Blackjack
play_blackjack()

During the game, youโ€™ll be prompted to enter:

  • Number of players

  • Number of decks

  • Whether to hit, stand, surrender, double down, or split (depending on your hand)

๐Ÿ“ฆ Package Structure

Function Purpose
create_board() Generates a shuffled deck of cards
deal_cards() Deals cards to players and dealer
score_hand() Calculates the score of a hand
player_split() Splits a hand if the two cards match
double_down() Performs a double-down action
surrender_hand() Executes a surrender decision
dealer_play() Implements the dealerโ€™s turn logic
insurance_bet() Handles insurance option if dealer shows an Ace
announce_winner() Compares scores and determines outcomes
play_blackjack() Runs the full interactive game

๐ŸŽฎ Play Now

Explore the gameplay, test your strategy, and try your luck โ€” enjoy Blackjack in R!

Good luck, and may the odds be in your favor! ๐Ÿ€๐Ÿƒ