Ruby Project: 21/Blackjack (Object-Oriented Programming)

Click here to view this project on Github.

This is an object-oriented programming implementation of 21 (Blackjack) written in Ruby. It runs in the command line, but the emphasis is on OOP design: a Game object orchestrates the round, Player and Dealer inherit shared behavior from a Participant base class, and individual Card objects calculate their own values (including dynamic Ace handling).

A Deck object generates and shuffles the full 52-card deck, and a few small modules (Utility, GameMessages, WinningScore, etc.) keep reusable behavior (screen clearing, UI animations, shared constants) organized and easy to mix in.

Skills demonstrated:

  •     Ruby
  •     Object-oriented programming (classes, inheritance, encapsulation)
  •     Collaboration between objects (Game ↔ Player/Dealer ↔ Deck/Card)
  •     Modules and mixins (shared behavior and shared constants)
  •     Program design (separation of responsibilities, reusable components)
  •     Game logic (hit/stay flow, dealer rules, bust/tie logic, winner determination)
  •     State management (hands, deck mutation, round resets)
  •     User experience polish (animated messages, dynamic prompts, screen clearing)

Leave a Reply

Your email address will not be published. Required fields are marked *