Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 04-20-2009, 01:41 AM   #23 (permalink)
jsonli
Registered Member
 
Join Date: Nov 2008
Posts: 188
jsonli is on a distinguished road
Default

Quote:
Originally Posted by iphonedev. View Post
Roght now I got all the cards to shuffle using NSNumbers that start out 1-52 then there indexes change like the code i posted before. Based on those indexes I can set the images to the corresponding index for the user to see them. Now I am stuck as how to do one thing, I am making blackjack so I need to see if the cards are geater than 21 added up, so that means that (since the cards are label 1-52) it will not always add up to want. Say Number 1 is Jack of spades, and Number 10 is Ace of Spades. Those do not add up to 21, they add up to 11, so how do I reassign these values so that Jack of Spades is 10 and Ace of Spades is eleven, etc.

Sorry if that was confusing lol
Instead of shuffling the images... you should shuffle the "idea" of a card. I guess you could create a Card class.

On a side note, is there not already a blackjack app available? If there is, there's no rush... and I would learn the programming fundamentals properly. It will only help you in the long run.
jsonli is offline   Reply With Quote
 

» Advertisements
» Online Users: 443
17 members and 426 guests
apatsufas, aziz, ChrisYates, dfvdan, Dimpleppanchal, Duncan C, Gaz, Hamy, itra, jeroenkeij, LegionMD, mehmood.memon, monu_rastogi, mraalex, Paxtorn, Robemtims, smithdale87
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,617
Threads: 94,087
Posts: 402,799
Top Poster: BrianSlick (7,990)
Welcome to our newest member, kellyschoemaker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:34 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.