Excel Blackjack

blackjack
Download Zipped File

Description

This program was written by Carlos Rondão.

The good news for us VBA geeks is that this game's modules are open for inspection. The bad news for those of us who are not literate in Portugese is that this may not lead to much understanding. If you want to learn how to use cards in your own Excel games endeavors, you should see his tutorial at Cyberbolsa (look under Conteudos:downloads). With the help of Babelfish, I think I have got some understanding.

Basically, the program makes use of Excel VBA's ability to manipulate pictures in order to define and manipulate the cards. Carlos inserted the 52 pictures and named them in order as C 1, C 2, ..., C 52. Using Modulo 13 arithmetic you can assign the proper value and suit to each card in the VBA code. The VBA can then treat the deck as a 52 element array, and pull up the correct picture by reference. Pretty simple, really, aside from the painful part of setting up the pictures initially.



Comments

This site's comment form has been retired -- shown below is the archived comment history from the previous site.