Skip to content

MonashARP/game-package-wallabies

Repository files navigation

Blackjack

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! 🍀🃏

About

game-package-wallabies created by GitHub Classroom

Resources

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors