Skip to content

Commit cb80c2b

Browse files
committed
Fixed bug in shuffle algorithm
1 parent 3a2a1ab commit cb80c2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/commas.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ shuffle (cards)
152152
function shuffle(t)
153153
local n = #t
154154

155-
while n > 2 do
155+
while n >= 2 do
156156
-- n is now the last pertinent index
157157
local k = math.random(n) -- 1 <= k <= n
158158
-- Quick swap

0 commit comments

Comments
 (0)