Computer Science Canada Blackjack game help |
Author: | zOriginaL [ Fri Jun 11, 2010 7:54 pm ] |
Post subject: | Blackjack game help |
What is it you are trying to achieve? I am trying to make a blackjack game. So far, I have the background image of the table, a score bar, images of all 52 cards. What is the problem you are having? How do I use arrays and randint to create the random number and based on the number display the cards to the screen? I also need help with the "hit", "stay", "split" options and betting amount. |
Author: | tjmoore1993 [ Sat Jun 12, 2010 8:17 am ] |
Post subject: | RE:Blackjack game help |
With arrays you can do marvelous things, such as load a dozen things into a single variable. As well manipulate them to work with loops. However, in this case you should not be using regular arrays because this can cause severe lag issues. What I recommend is that you work with Flexible Arrays instead. What I mean by flexible is that you can easily push new values into the array. var CARD : flexible array 1..0 of int When you push new values you increase the 0 each time representing the cards used. Still stuck? Well whenever you push a new value remember, the value is stored. You can use this to your advantage as to checking for duplicates or cards that are used more then once. Anyways I left a few links below good luck. Normal arrays (get the concept) http://compsci.ca/holtsoft/doc/array.html Flexible arrays (Alternative) http://compsci.ca/holtsoft/doc/flexible.html Extra help (looping) http://compsci.ca/holtsoft/doc/for.html |