From 03412fcfd954dab47d8fa5751b29305e82aa2c20 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Fri, 31 Mar 2023 00:21:42 -0500 Subject: [PATCH] Seed rng with time. --- Solitaire/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Solitaire/main.cpp b/Solitaire/main.cpp index 83a3165..f50458c 100644 --- a/Solitaire/main.cpp +++ b/Solitaire/main.cpp @@ -125,14 +125,15 @@ class Solitaire : public olc::PixelGameEngine Card DrawCard() { std::uniform_int_distribution distribution(0, cardDeck.size()-1); int dice_roll = distribution(generator); - std::cout << dice_roll << std::endl; + //std::cout << dice_roll << std::endl; Card drawnCard = cardDeck[dice_roll]; cardDeck.erase(cardDeck.begin() + dice_roll); return drawnCard; } bool OnUserCreate() override { - for (int i = 0; i <= SPADE; i++) { + generator.seed(time(NULL)); +; for (int i = 0; i <= SPADE; i++) { for (int j = 1; j < 14; j++) { cardDeck.push_back({ (Suit)i,j }); }