Graph Poker Hand Distributions

Last time I showed how to Calculate Poker hand probabilities with code that showed how often a particular hand occurred, such as a Pair or a Full House. Now that we can calculate these probabilities, lets graph them. You’ll need to add references to some assemblies: System.Windows.Forms, System.Windows.Forms.DataVisualization, WindowsFormsIntegration First we’ll accumulate the results of…

0

Calculate Poker hand probabilities

In the last post I showed some code that displays playing cards using WPF. Now we’ll have some fun with the cards. Let’s calculate the probability of getting a particular poker hand. The program below shuffles the deck, then deals 5 cards by taking the first 5 cards into a “hand”. The hand is then…

0

Display Playing cards in WPF

I remember each version of Windows had new games. On Windows 3.1 many people played Solitaire. Windows for Workgroups 3.11 introduced Hearts. Somewhere along the way came FreeCell, MineSweeper and Spider Solitaire. This was years before more modern User interfaces, such as WPF existed. Windows no longer ships Cards.dll which has the images of the…

0

Debugging Monkeys on a Raspberry Pi

The last couple times I wrote about using a RaspBerry Pi and Windows IoT: https://blogs.msdn.microsoft.com/calvin_hsia/2017/03/16/getting-started-with-windows-internet-of-things-windows-iot/ https://blogs.msdn.microsoft.com/calvin_hsia/2017/04/29/create-a-security-system-with-cameras-on-your-windows-iot-raspberry-pi/ I was contemplating getting Monkeys working on an Arduino, but that would have required a lot more effort (I’d have to implement a lot of the base functionality, like collection classes, hash tables, I/O, etc.) and it would not…

0

Faster monkeys

Last time I showed how to simulate monkeys typing on typewriters, using letter frequencies based on input text, like Hamlet’s soliloquy. The results were remarkably similar to the input text, but the output was relatively slow. Below is a version that has the “Optimum” option that outputs much faster if the “-o” command line parameter…

0

More Shakespearean Monkeys

  While I was in high school, I attended a lecture at Yale University in 1974 about monkeys at a typewriter by William R. Bennet, Jr, one of the inventors of the helium-neon laser. Quote: He was also frequently seen at various sites around the Yale campus collecting data for his popular course on “The…

0

Use gravity to generate Cartoon animation frames

I wrote a cartoon animation program around 1982 in C. The Honolulu Academy of Arts asked me to demo the program in their Focus on Computer Graphics. The program allows the user to draw lines of a cartoon frame using the mouse. The user then saves that frame and draws another. To animate, the program…

1

Visual Sorting Part 1

Remember the days before the internet?   I have a collection of hundreds of programs that I wrote in the early 1980’s using the DeSmet C compiler. This is way before the internet age. My machine of choice was an IBM PC with 4.77 MHz 16 bit processor and 256K Ram, dual floppy disks, running…

0

Big numbers

When I first started learning about numbers I remember marveling at what infinity means. How many integers are there? Are there more real numbers than integers? How many numbers are there between zero and 1? Then I remember thinking about how these numbers get to be so big… so many digits. Then I started playing…

0

Drawing old playing card images for bridge

About 11 years ago I wrote a blog about Contract bridge card distributions. When you play bridge, with a normal 52 card deck, it helps to know about how often a particular suit distribution might occur. For example, if you and your partner have 9 Spades, then the opponent’s spade holding of 4 spades might…

1