Sha256: f6a1914d63c6d5b62f0f7e27fc446dd8d57a05f80835e69d0992af578973df6c

Contents?: true

Size: 348 Bytes

Versions: 132

Compression:

Stored size: 348 Bytes

Contents

#import "GrainsExample.h"
@implementation Grains : NSObject

-(long long)grainsAtSquareNumber:(int)squareNo {
	if (squareNo <= 64 && squareNo > 0) {
		return pow(2, squareNo - 1);
	}
	return -1;
}

-(long long)grainsAtBoard {
	long long total = 0;
	for (int i = 1; i <= 64; i++) {
		total += [self grainsAtSquareNumber:i];
	}
	return total;
}

@end

Version data entries

132 entries across 132 versions & 1 rubygems

Version Path
trackler-2.2.1.78 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.77 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.76 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.75 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.74 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.73 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.72 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.71 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.70 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.69 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.68 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.67 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.66 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.65 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.64 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.63 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.62 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.61 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.60 tracks/objective-c/exercises/grains/GrainsExample.m
trackler-2.2.1.59 tracks/objective-c/exercises/grains/GrainsExample.m