RNGenie.Cards
0.1.0-alpha.2
dotnet add package RNGenie.Cards --version 0.1.0-alpha.2
NuGet\Install-Package RNGenie.Cards -Version 0.1.0-alpha.2
<PackageReference Include="RNGenie.Cards" Version="0.1.0-alpha.2" />
<PackageVersion Include="RNGenie.Cards" Version="0.1.0-alpha.2" />
<PackageReference Include="RNGenie.Cards" />
paket add RNGenie.Cards --version 0.1.0-alpha.2
#r "nuget: RNGenie.Cards, 0.1.0-alpha.2"
#:package RNGenie.Cards@0.1.0-alpha.2
#addin nuget:?package=RNGenie.Cards&version=0.1.0-alpha.2&prerelease
#tool nuget:?package=RNGenie.Cards&version=0.1.0-alpha.2&prerelease
🎩 RNGenie.Cards 🃏
Deterministic Deck Creation, Shuffling, and Drawing
RNGenie.Cards provides utilities for working with standard playing-card decks.
Build 52-card decks (with or without Jokers), or define your own composition using the existing Card
type.
Shuffle deterministically with seeded RNG and draw cards with ease - perfect for simulations, games, and experiments.
✨ Features
- Standard deck support (52 cards, optionally with Jokers).
- Custom deck compositions of the built-in
Card
type via constructor. - Deterministic shuffling when used with seedable RNG sources (built-in Fisher-Yates).
- Card operations: draw, peek, reset, remaining count.
- Two shuffle modes: full deck (
Shuffle
) or remaining only (ShuffleRemaining
).
📄 Documentation
See the Card Docs for usage and API details.
🚀 Quick Start
Install Core + Cards:
dotnet add package RNGenie.Core
dotnet add package RNGenie.Cards
Basic usage:
using RNGenie.Core.Sources;
using RNGenie.Cards;
// Seedable RNG for reproducibility
var rng = new Pcg32Source(seed: 123);
// Create a standard deck with Jokers
var deck = new Deck(includeJokers: true);
// Shuffle deterministically
deck.Shuffle(rng);
// Draw cards
var topCard = deck.Draw();
Console.WriteLine($"First card: {topCard}");
var hand = deck.Draw(5);
Console.WriteLine("Hand: " + string.Join(", ", hand));
// Remaining cards
Console.WriteLine($"Cards Remaining: {deck.RemainingSpan.Length}");
Output:
First card: Q♣
Hand: 7♠, A♥, 2♦, K♣, 9♠
Cards Remaining: 47
Custom composition example:
// Short deck (strip 2-5)
var shortDeck = new Deck(
from s in Enumerable.Range(0, 4)
from r in Enumerable.Range(6, 8) // 6..13
select new Card((Suite)s, (Rank)r)
);
🧩 Extensibility
Extend RNGenie.Dice by:
- Creating custom compositions of the built-in
Card
type (e.g. short decks, Pinochle). - Adding wrappers for discard/reshuffle mechanics.
- Implementing alternate shuffle algorithms.
📦 Roadmap
- Built-in helpers for custom deck types (short deck, Pinochle, Tarot).
- Support for discard and reshuffle utilities.
- JSON-driven deck definitions.
- Integration samples with game frameworks.
👩💻 Contributing
Pull requests are welcome!
Good first issues:
- Add new deck variations.
- Extend shuffle options.
- Add helper utilities for discard/reshuffle.
See CONTRIBUTING.md for guidance. Also, check here for existing card issue writeups.
📜 License
RNGenie is licensed under the MIT License. This means you're free to use it in open source, commercial, or personal projects.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- RNGenie.Core (>= 0.1.0-alpha.2)
-
net8.0
- RNGenie.Core (>= 0.1.0-alpha.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.1.0-alpha.2 | 112 | 9/12/2025 |