+ Reply to Thread
Results 1 to 2 of 2

cards and permutations

  1. #1
    Forum Contributor
    Join Date
    03-12-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    118

    Smile cards and permutations

    Hello
    I am trying to find a quick way to pull down a list of all possible combinations with a macro but I got stuck.

    I have a deck of 18 cards:
    5 clubs (2 to 6)
    5 diamonds (2 to 6)
    8 spades (2 to 9)

    the dealer takes out 3 of them chosing one per suit for him and keep them covered.


    The remaining 15 cards are shuffled distributed randomly to 5 players, each one with 3 boxes on the table (the players can also have 3 cards of the same suit! it's only the dealer that has one for each suit).

    Of these 15 cards, 8 cards are randomly chosen to stay face up and 7 are face down.

    Now, given that I know which ones are the 10 cards I don't see (the 3 of the dealer, which I know are 1 per suit and the 7 face down) I first need (a macro?) to identify the possible combinations the dealer can have (number may vary but it should not exceed 100/120 roughly)

    Once I have identified the 3 cards the dealer might have, I will can easily find out which are remaining 7 cards.

    Now, I know that with 7 cards I have 5,040 permutations possible. Well that is what I need, multiplied by the number of dealer combinations...

    So the macro should put in column A the combination name (can concatenate the 3 dealer card codes?) and for each of the rows, columns B to I the card value (example: 3C, 2D, 9S, 7S, 4D, 2C, 8S, 3S) and so on.

    I hope I have given all the needed information.

    And really hope some gentlemen can send me the code

    thank you in advance

  2. #2
    Forum Contributor
    Join Date
    03-12-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    118

    Re: cards and permutations

    In the meantime I have found a way to generate the 5040 permutations of the string abcdefg
    I will create now a macro that substitues the letters with the cards.
    So I am ok thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using a UserForm to Display Playing Cards - problem with overlapping cards
    By joebbb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2017, 04:49 PM
  2. Replies: 2
    Last Post: 09-17-2017, 10:34 AM
  3. Replies: 2
    Last Post: 12-10-2013, 02:58 PM
  4. Permutations
    By alan73 in forum Excel General
    Replies: 3
    Last Post: 11-07-2011, 06:37 PM
  5. Permutations
    By Christopher_1 in forum Excel General
    Replies: 7
    Last Post: 07-05-2010, 02:28 PM
  6. [SOLVED] permutations
    By newyorkjoy in forum Excel General
    Replies: 3
    Last Post: 11-02-2005, 06:17 PM
  7. [SOLVED] Permutations
    By RedChequer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2005, 12:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1