Skip to content

anonymous /gist:5084934

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
//
// Bytelandian.h
// 121 bytelandian
//
#import <Foundation/Foundation.h>
@interface Bytelandian : NSObject
{
int value;
}
@property int value;
- (id) initWithValue: (int) v;
- (int) CalcChange: (int) n;
@end
//
// Bytelandian.m
// 121 bytelandian
//
#import "Bytelandian.h"
@implementation Bytelandian
@synthesize value;
- (id) initWithValue: (int) v
{
self = [super init];
if (self)
{
[self setValue: v];
}
return self;
}
- (int) CalcChange: (int) n
{
if (n == 0)
return 1;
else
return ([self CalcChange: (n / 2)] +
[self CalcChange: (n / 3)] +
[self CalcChange: (n / 4)]);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.