Details of this Paper

ios xcode




Build the MatchCard App Game;The UI does not have to be identical- feel free to experiment with a different setup as long as its intuitive to the user and you can code the logic.;But I'd like to see a similar logic. If you change the UI controls or scoring scheme for the players, please make a note of it when you submit your assignment.;#import "CardGameViewController.h;@interface CardGameViewController ();@end;NSArray *validSuits, *validRanks;@implementation CardGameViewController;- (void)viewDidLoad;[ super viewDidLoad];// Do any additional setup after loading the view, typically from a nib.;validSuits = @[ @"?", @"?", @"?", @"?" ];validRanks = @[ @"A", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10", @"J", @"Q", @"K" ];NSLog(@"Displaying suits\n");for (int i=0, i < validSuits.count, i++);NSLog(@"Suit at index %d is %@\n",i, validSuits[i]);NSLog(@"Displaying ranks\n");for (int i=0, i < validRanks.count, i++);NSLog(@"Rank at index %d is %@\n",i, validRanks[i]);[ self resetTheGame];- (void)didReceiveMemoryWarning;[ super didReceiveMemoryWarning];// Dispose of any resources that can be recreated.;-(void)resetTheGame;yourScore = phoneScore = 0;lblExplanation.text = @";[ self updateScores];-(void)updateScores;NSString *scoreText = [NSString stringWithFormat: @"Your score is %d", yourScore];lblYourScore.text = scoreText;scoreText = [NSString stringWithFormat: @"Phone's score is %d", phoneScore];lblPhoneScore.text = scoreText;- (IBAction)gameReset:(id)sender;[ self resetTheGame];- (IBAction)touchedCard:(UIButton *)sender;//UIButton *pButton = (UIButton *)sender;if ([sender.currentTitle length]);//When the card front is showing - flip it to show the back for both cards;[sender setBackgroundImage:[UIImage imageNamed: @"CardBack.jpg" ] forState:UIControlStateNormal];[sender setTitle: @"" forState:(UIControlStateNormal)];[btn2 setBackgroundImage:[UIImage imageNamed: @"CardBack.jpg" ] forState:UIControlStateNormal];[btn2 setTitle: @"" forState:(UIControlStateNormal)];lblExplanation.text = @";else;//When the card back is showing - flip it to show the rank and suit for both cards;//Add your logic here to decide who scores higher and why;//Display the updated score and results to the user;@end;#import;@interface CardGameViewController: UIViewController;int yourScore;int phoneScore;IBOutlet UIButton *btn2;IBOutlet UILabel *lblYourScore;IBOutlet UILabel *lblPhoneScore;IBOutlet UILabel *lblExplanation;- (IBAction)touchedCard:(UIButton *)sender;- (IBAction)gameReset:(id)sender;@end


Paper#64583 | Written in 18-Jul-2015

Price : $127