Re: Help With My Game of Black Jack

new topic     » topic index » view thread      » older message » newer message

sequence cards,shuffled,newdeck
atom card
card = 1
cards = repeat(0,52)
shuffled = cards
newdeck = cards

>>for c = 1 to 52 do
>>cards[c] = c
>>end for

>>newdeck = cards  -- now we have a permanent new deck

>>for c = 52 to 1 by -1 do        -- shuffle the cards
>>card = rand(c)                                                     --
>>select a card
>>shuffled[c] = cards[card]                                      -- put it
>>face down
>>cards = cards[1..(card - 1)] & cards[(card + 1)..c]  -- put deck back
>>together
>>end for                                                               --
>>do it again

>>print(1, shuffled)          -- write out the shuffled deck from the first
>>card to
                                 --  to the last

Hey this is good but how do I do this and associate the shuffled deck to
actual bitmaps. So when I click on "Hit Me" a card is shown at a designated
place in my window, and more importantly, so when "Hit Me" is clicked again
the next card is shown just to the side of the first card. Thanks again for
your responces.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu