Hi
I know this is unlikely to be considered a useful or practical purpose for excel, however, i like to set myself challenges using excel to see if i can find a way of acheiving this (normally i can teach myself a few new more practical tricks along the way). Anyway, this time round, i am trying to create a simulator that will function as playing a game of blackjack. Enough of the introduction, lets get on with what i need help with
I want to find a way to simulate somebody dealing from a deck of cards.
What I have done currently:
- using the rand function to pick a number between 1-13 (as whole integers) - where 1=A, 2=2....12=Q, 13=K etc
- i have a wide array of if formulas working upon this data to then dictate by the number that appears what card this displays, and what this card then equals (so it works out that a Jack equals 10 etc).
- with all this information running in the background, I have a prettier front sheet (that looks more similar to a blackjack table at a casino) that then displays this.
- although macros are the last thing i will add (so they are not currently on there), I have been making extensive notes on what each macro will perform. For example, there will be a button that will be titled "Deal", and pressing this will present two cards in front of you, and show one card in front of the dealer.
What I am having problems with currently:
(1) Mainly, I want this to work more like an actual deck of cards. By saying that I mean that there are 52 cards in the deck, and once the king of spades has been drawn, it cannot come up as the next card as it is now on the table. Admitidly, I would like to actually create something where it would be working with about 6 decks of cards, but i guess in theory if it can be done with one deck, it can be done with 6 as well.
But it is important to remember that this will be able to function for more than just one hand of blackjack being played. So, after the first hand has been played, and we may have lost 6 cards in total, for the next hand, there will only be 46 cards left in the deck, and it will somehow need to remember this (potentially to a point where it automatically shuffles the deck - or as it would work in practice, go back to a full deck to randomly select from, and then continue without reseting everything - as you will have a running bank that will have increased/decreased by this point).
Does anyone have any ideas, preferably without any form of coding/programming that could achieve this? Dont mind if it is tediously painstaking to type out!
(2) The second problem I am having, which is less of an issue right now, is making the ace perform as a 1 or 11. Any not too familiar with blackjack, you can use an ace as either number...so if i had 16, took a card, and it was an ace, it would equal 17 as my total. However, if i had 10, took a card, and it was an ace, this would give me 21.
For the life of me, i cannot find a way of making the aces value, considering that you could potentially get dealt 6 and an Ace, draw a card and take another Ace, and this would equal 18, with the first ace equalling 11 and the second equalling 1. If anyone has any ideas for that it would be very helpful also.
Thanks in advance for your help, i will be very grateful for any assistance you can provide. Like i've said, i realise that this is not your normal, 'having a few problems with my stock take' or something like that, but i struggle to find something that cant be done in excel, and i hate admitting defeat!!
Bookmarks