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. #30

Closed sethdivyansh closed 1 month ago

sethdivyansh commented 1 month ago

Description

  1. Added black to CardColor in types.d.ts.
  2. Split special and wild cards into specialValues and wildCardValues arrays.
  3. For each color in the colors array:
    • Add two cards for each number (0-9), except one card for '0'.
    • Add two cards for each special value.
    • For 'black', add four cards for each wild card value.

Fixes: #1

Checklist

kuv2707 commented 1 month ago

Can you edit the commit message to occupy less width per line?

sethdivyansh commented 1 month ago

Can you edit the commit message to occupy less width per line?

I have shortened the commit message.

kuv2707 commented 1 month ago

Great work! It would be further great if you could add some tests to verify if the array generated has all the cards in the right amount. Feel free to take the test cases from this PR if you don't feel like writing it yourself (do credit the author for it though).

sethdivyansh commented 1 month ago

@kuv2707 Please check I have made the desired changes and added a test to validate the created function.

kuv2707 commented 1 month ago

Merged, thanks @sethdivyansh ! This is a huge progress and unblocks further work on the engine. Also, good to see all the backend checks passing. The prettier test was failing due to a small error from my side.