Random Number Generator - Blackjack

F

Flamikey

Another Random generator question.

I am learning to play blackjack. I created a table with possibl
dealer cards as column headers starting in column
(2,3,4,5,6,7,8,9,10,A). I have possible player hand going down th
rows in column
(8,9,10,11,12,13,14,15,16,17,18,19,20,AA,22,33,44,55,66,77,88,99,10,10,A2,A3,A4,A5,A6,A7,A8,A9,A10)
(CELL A1 IS BLANK). In each cell I inputed the proper basic strateg
play (X for split, S for stand, H for hit, or D for double down).


I would like a random generator to pull 1 dealer card and one playe
hand. In another cell I would like to enter the proper play i.e. X fo
split, S for stand, H for hit, or D for double down. I would then lik
to lookup my entered play in the basic startegy table above an
conditional format the "entered" cell so that if my play matches th
table the cell is green and if I enter an incorrect play (lookup valu
is different from the entered value) the cell goes red. I know how t
do the concatenate, conditional formatting, and VLOOKUP functions bu
don't know how to get the random function to pull alpha characters, o
to concatenate random functions to pull both a player hand and deale
card.

Anyway to do this
 
B

Biff

Hi!

You need VBA to do this. You can "deal" random cards easy
enough using formulas but the problem with that is the
functions needed are volatile functions. This means the
values they return change every time the workbook
recalculates.

Suggest you post this in the Programming group.

Biff
 
D

Dick Kusleika

Flamikey

Put your possible dealer hands in a column, say A20:A29. In B20:B29, put
the function =RAND() to generate random numbers. In C20:C53, put the player
hands and in D20:D53, put =RAND().

Now sort A20:B29 on column B and sort C20:D53 on column D. The hands in A20
and C20 will be a random hand for each player. Then use your VLOOKUP on
those cells. Repeat the sort for new random hands. Note that the RAND
results will change and won't appear to be sorted correctly, but it will
still give you random hands.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top