Skip to content

Commit 2983b0e

Browse files
committed
Update UnoDeck.hx
1 parent 346e2d8 commit 2983b0e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/games/uno/backend/UnoDeck.hx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ class UnoDeck {
5959
}
6060

6161
while (cards.length < 108) {
62-
for (i in 1...10) {
62+
// Fill remaining cards with number cards to reach 108 cards
63+
// This is just to ensure the deck has 108 cards if colors are small.
64+
for (color in colors) {
65+
// Add one 0 card for each color
66+
cards.push(new UnoCard(color, NUMBER, 0));
67+
68+
for (i in 1...10) {
6369
cards.push(new UnoCard(color, NUMBER, i));
6470
cards.push(new UnoCard(color, NUMBER, i));
6571
}

0 commit comments

Comments
 (0)