The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Objective C Code
Posted by: UnsignedCode | September 18, 2010 @ 11:05am
Objective C Code
[
Download
]
- (void) loadRangeData { NSBundle *bundle = [NSBundle mainBundle]; NSString *textFilePath = [bundle pathForResource:@"pfhr" ofType:@"txt"]; NSString *fileContents = [NSString stringWithContentsOfFile:textFilePath]; NSArray *quizArray = [[NSArray alloc] initWithArray:[fileContents componentsSeparatedByString:@"\n"]]; NSString *temp; NSArray *atemp; NSString *offset; handSliderValues = (float*) malloc(sizeof(float) * [quizArray count]); handSliderCells = (int*) malloc(sizeof(float) * [quizArray count]); for (int i = 0; i < [quizArray count]; i++) { temp = (NSString*) [quizArray objectAtIndex:i]; atemp = [temp componentsSeparatedByString:@","]; float perc = [[atemp objectAtIndex:1] floatValue]; offset = [atemp objectAtIndex:0]; int x = 0; int y = 0; if ([offset length] == 3) { // offsuit if ([offset characterAtIndex:2] == 'o') { x = [Card getRankInt:[offset characterAtIndex:0]]; y = [Card getRankInt:[offset characterAtIndex:1]]; } else { y = [Card getRankInt:[offset characterAtIndex:0]]; x = [Card getRankInt:[offset characterAtIndex:1]]; } } else { // pair x = [Card getRankInt:[offset characterAtIndex:0]]; y = x; } int ofs = (12-y) * 13 + (12-x); handSliderCells[i] = ofs; handSliderValues[i] = perc; } // [bundle release]; // [textFilePath release]; // [fileContents release]; // [quizArray release]; [temp release]; [atemp release]; // [offset release]; }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.58 / 8
53 Votes
http://codebin.yi.org/843
page generated in 0.01 seconds