How to implement a dealer class without storing a deck of cards?

前端 未结 8 1273
长发绾君心
长发绾君心 2021-02-09 19:07
  • Question

    Even only 52 cards, the permutationIndex where I describe in Explanations section, would be a huge number; it is

8条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 19:25

    You have working - and extremely efficient c# example for The kth Permutation of Order n (aka PermutationIndex) at this very old post:

    • http://msdn.microsoft.com/en-us/library/Aa302371.aspx#permutat_topic3

    For those interested in Combinations topic:

    • http://msdn.microsoft.com/en-us/magazine/cc163957.aspx
    • http://msdn.microsoft.com/en-us/library/Aa289166(VS.71).aspx

    I suggest that you read through, before going into specific implementation.

提交回复
热议问题