ggneilc / poker-sim

web browser based card games prioritizing a truly random experience
0 stars 0 forks source link

Card & Deck class & functions #2

Open ggneilc opened 2 months ago

ggneilc commented 2 months ago

We have a basic card class, and a deck is made up of cards. However the current implementation just uses random.randint which, because its the standard package, will generate a uniform distribution of random numbers & not adhere to real life where a deck can only have 1 copy of each card.

  1. Create a deck that will have only have 1 copy of each card
  2. Have the new cards be pulled from the deck in a random fashion that isn't a uniform distribution
ggneilc commented 16 hours ago

This has been cleaned up by randomly indexing according to the current time, and the basic Card and Deck class are fully setup to be able to set as database objects (by turning in and out of JSON) and its to_string is also nice.

This comment can be closed when we turn it into a python package that we can pip install cards and potentially remove the source code from our apps all together