shivansh-bhatnagar18 / multiplayer-uno

https://multiplayer-uno.vercel.app
20 stars 43 forks source link

deck: completed function to create and shuffle a UNO card deck. #29

Closed sethdivyansh closed 1 month ago

sethdivyansh commented 1 month ago

Fixes: #1

Description

  1. added black as a color in CardColor in types.d.ts
  2. separated the values of special cards and wild cards into two arrays named specialValues and wildCardValues, respectively.
  3. Iterates over each color in the colors array. For each color:
    • Iterates over each number value (0 to 9) in the numValues array and adds two cards of that color for each number, except for '0' where only one card is added.
    • Iterates over each special value in the specialValues array and adds two cards of that color for each special value.
    • If the color is 'black', iterates over each wild card value in the wildCardValue array and adds four cards of that color for each wild card value.

Checklist