Poker Simulator

Jan 14, 2008

i am trying to write a simulator for poker. I am struggleing to find the most efficient way to deal out a deck of cards.

If I number each card 1 - 52 i can generate the first card using the randombetween function but lets say it generates the the four of clubs, which is card number "4" out of the cards 1 - 52.

Now the second card i want to generate is one of 51 not of 52. Also i do not want to gererate the four of clubs again.

how to make this as efficient as possible, i wish to use this to do a helluva alot of simulations so the more efficient the code the better.

View 9 Replies


ADVERTISEMENT

Roulette Simulator

Mar 30, 2009

I would like to have a list of student names, and a command button, that when pressed, begins highlighting the names one at a time ( starting at the top, moving down through the list, then starting at the top again, moving down through the list again, etc etc) each time the time that each name is highlighted gets longer and longer, effectively like a roulette wheel.

Eventually, one of the names would remain highlighted.

When the command button is pressed again, the 'roulette' highlighting process starts again, and eventually another name would be highlighted.

I already have a 'random student selector' program operating that returns a student name randomly and without ever returning a name twice, but it lacks the drama and suspense this 'roulette' method might provide.

View 9 Replies View Related

Poker Part 1 Of 2

Dec 3, 2006

Like the one at the casino machines.

A1 to A52 like this :
A1 value = As (Ace spades)
A2 value = Ah (Ace hearts) etc...etc..

Randomize like this:

Sub Makerandomlist()
Dim v As Variant
With Worksheets("Sheet1")

With .Range("A1:A" & (Range("A65536").End(xlUp).Row))

v = .Value
.Offset(0, 1).Formula = "=Rand()"
.Resize(, 2).Sort Key1:=.Offset(0, 1)
.Offset(0, 1).Value = .Value
.Value = v

End With
End With
End Sub
Transpose [A1:A5] in [C1:G1]

In a hidden column 52 JPG's (all cards in a deck)
using cases how can i do the equivalent of fifty two If's ?

If [A1] = AhThen
ActiveSheet.Shapes("Picture 3").Copy
Range("C1").Select
ActiveSheet.Paste

End If

View 9 Replies View Related

POKER SPREADSHEET

Oct 29, 2003

writing a spreadsheet that interprets poker hands. I've finished, and it works. I have successfully dealt "Texas Hold Em" poker to 10 players, dealt 5 community cards, and then interpreted the best poker hand and declared a winner.

I did it by using separate tables testing whether certain poker hands existed or not, and I used completely intrinsic Excel functions, NO VBA. That's for those of you who said it couldn't be done! I may soon introduce VBA to slow down the calculations using buttons, and simple things, but Excel can do this.

View 9 Replies View Related

Listing The 2, 598, 960 Different Poker Hands In Separate Cells

Nov 11, 2007

Let's say My criteria is :

1 2 3 4 5 6 7 8 9 10 J Q K A (13 ranks of cards)
s c d h (4 different suits...s=spades c = clubs,etc)
5 would be the number of draws of 1 card to make a poker hand

How would I go about listing the 2, 598, 960 different poker hands in separate cells?

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved