Does something like Python generator exist in objective-c ?
I have following code on few places, so is there some way to simplify it ?
int maxWinInRow = [self maxWinInRow];
// how many wins in row
for (int i=1; i <= maxWinInRow; i++) {
NSString * key = [NSString stringWithFormat:@"%d",i];
NSNumber * value = [_winsInRow valueForKey:key ];
int numbeOfWinInRow = value.intValue;
// only this line is specific
gameScore = gameScore + ( pow(6,i) * numbeOfWinInRow);
}