From 1d3667f37d1da1da959a573e254186e354646eac Mon Sep 17 00:00:00 2001 From: Musty Mustelidae Date: Sat, 8 Mar 2014 01:23:21 -0500 Subject: [PATCH] =?UTF-8?q?Implemented=20Fisher=E2=80=93Yates=20shuffle.?= =?UTF-8?q?=20Assumes=20RNG=20function=20is=20in=20form=20getNumber(min,ma?= =?UTF-8?q?x),=20with=20min=20and=20max=20inclusive=20(Did=20not=20find=20?= =?UTF-8?q?documentation=20on=20function)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/server_cardzone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/server_cardzone.cpp b/common/server_cardzone.cpp index d39c71b7..c6c1a854 100644 --- a/common/server_cardzone.cpp +++ b/common/server_cardzone.cpp @@ -45,7 +45,7 @@ void Server_CardZone::shuffle() { for (int i = cards.size() - 1; i > 0; i--){ int j = rng->getNumber(0, i);//Assuming i is inclusive, i + 1 if exclusive (end result should be a number between 0 and i [0 and i included]) - cards.swap(j,i) + cards.swap(j,i); } playersWithWritePermission.clear(); }