Skip to content

AlexLeetDev/FarkleGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎲 Farkle Dice Game

This project is a C++ implementation of the classic dice game Farkle.
It was originally developed for a previous course and will be further enhanced as part of my CS 499 Capstone Project.
This project demonstrates my understanding of object-oriented programming, algorithm design, and structured code organization in C++.


🧩 Overview

Farkle is a turn-based dice game where players roll six dice and earn points for specific combinations, such as triples or certain numbers.
The goal is to reach a target score before your opponent, but if you "Farkle" (roll no scoring dice), you lose all points for that turn.

This version of the game runs in the console and allows players to:

  • Roll dice and view the results
  • Choose which dice to keep for scoring
  • Track scores between players
  • View the official game rules from a text file (farkle_rules.txt)

🧠 Features

  • Object-Oriented Design: Organized using Game, Player, and Dice classes.
  • Algorithmic Scoring: Calculates points according to Farkle rules.
  • File Handling: Reads game rules from an external text file.
  • User Input: Lets players select which dice to keep or reroll.
  • Modular Codebase: Source code is split into multiple files for clarity and maintainability.

πŸš€ Planned Enhancements

For my upcoming capstone work, I plan to build on this project by:

  • Expanding the scoring logic to include new combinations (such as straights and three pairs).
  • Improving input checks so the program can handle mistakes or invalid entries more smoothly.
  • Making the code easier to read and update by cleaning up how the scoring logic is written
  • Adding more helpful comments and documentation to explain how each part of the program works.

These updates will make the program more user-friendly, reliable, and easier to maintain.


πŸ—‚οΈ Project Structure

FarkleGame/
β”œβ”€β”€ FarkleGame/
β”‚   β”œβ”€β”€ Dice.cpp                    # Handles dice rolls and random values
β”‚   β”œβ”€β”€ Dice.h
β”‚   β”œβ”€β”€ Player.cpp                  # Stores player data and total scores
β”‚   β”œβ”€β”€ Player.h
β”‚   β”œβ”€β”€ Game.cpp                    # Main game logic and scoring calculations
β”‚   β”œβ”€β”€ Game.h
β”‚   β”œβ”€β”€ rules_reader.cpp            # Loads rules from a text file
β”‚   β”œβ”€β”€ rules_reader.h
β”‚   β”œβ”€β”€ farkle_rules.txt            # Reference file with Farkle rules
β”‚   β”œβ”€β”€ FarkleGame.vcxproj          # Visual Studio project file
β”‚   β”œβ”€β”€ FarkleGame.vcxproj.filters
β”‚   β”œβ”€β”€ FarkleGame.vcxproj.user
β”‚   └── main.cpp                    # Entry point of the program
β”œβ”€β”€ FarkleGame.sln                  # Visual Studio solution file
β”œβ”€β”€ .gitignore               
└── README.md                 

🧰 How to Run

  1. Open in Visual Studio:
    • Double-click FarkleGame.sln to open the solution.
  2. Build the project:
    • Select Build β†’ Build Solution (or press Ctrl+Shift+B).
  3. Run the game:
    • Press Ctrl+F5 to start without debugging.
  4. Follow the on-screen prompts to play!

πŸ‘¨β€πŸ’» Author

Alex Leet
Computer Science Student & Developer
πŸ“« GitHub: AlexLeetDev

About

C++ implementation of the Farkle Dice Game.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages