Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

task #1 completed #430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
255 changes: 255 additions & 0 deletions osx-project-1/osx-project-1.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
8410757C1657FD59003201D6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8410757B1657FD59003201D6 /* Foundation.framework */; };
8410757F1657FD59003201D6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8410757E1657FD59003201D6 /* main.m */; };
841075831657FD59003201D6 /* osx_project_1.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 841075821657FD59003201D6 /* osx_project_1.1 */; };
8410758B1657FDB8003201D6 /* Cell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8410758A1657FDB8003201D6 /* Cell.m */; };
8410759216580D7C003201D6 /* Cell+Mutator.m in Sources */ = {isa = PBXBuildFile; fileRef = 8410759116580D7C003201D6 /* Cell+Mutator.m */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
841075751657FD59003201D6 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
841075831657FD59003201D6 /* osx_project_1.1 in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
841075771657FD59003201D6 /* osx-project-1 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "osx-project-1"; sourceTree = BUILT_PRODUCTS_DIR; };
8410757B1657FD59003201D6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
8410757E1657FD59003201D6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
841075811657FD59003201D6 /* osx-project-1-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "osx-project-1-Prefix.pch"; sourceTree = "<group>"; };
841075821657FD59003201D6 /* osx_project_1.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = osx_project_1.1; sourceTree = "<group>"; };
841075891657FDB8003201D6 /* Cell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cell.h; sourceTree = "<group>"; };
8410758A1657FDB8003201D6 /* Cell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cell.m; sourceTree = "<group>"; };
8410759016580D7C003201D6 /* Cell+Mutator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Cell+Mutator.h"; sourceTree = "<group>"; };
8410759116580D7C003201D6 /* Cell+Mutator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Cell+Mutator.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
841075741657FD59003201D6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8410757C1657FD59003201D6 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
8410756C1657FD59003201D6 = {
isa = PBXGroup;
children = (
8410757D1657FD59003201D6 /* osx-project-1 */,
8410757A1657FD59003201D6 /* Frameworks */,
841075781657FD59003201D6 /* Products */,
);
sourceTree = "<group>";
};
841075781657FD59003201D6 /* Products */ = {
isa = PBXGroup;
children = (
841075771657FD59003201D6 /* osx-project-1 */,
);
name = Products;
sourceTree = "<group>";
};
8410757A1657FD59003201D6 /* Frameworks */ = {
isa = PBXGroup;
children = (
8410757B1657FD59003201D6 /* Foundation.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
8410757D1657FD59003201D6 /* osx-project-1 */ = {
isa = PBXGroup;
children = (
8410757E1657FD59003201D6 /* main.m */,
841075821657FD59003201D6 /* osx_project_1.1 */,
841075801657FD59003201D6 /* Supporting Files */,
841075891657FDB8003201D6 /* Cell.h */,
8410758A1657FDB8003201D6 /* Cell.m */,
8410759016580D7C003201D6 /* Cell+Mutator.h */,
8410759116580D7C003201D6 /* Cell+Mutator.m */,
);
path = "osx-project-1";
sourceTree = "<group>";
};
841075801657FD59003201D6 /* Supporting Files */ = {
isa = PBXGroup;
children = (
841075811657FD59003201D6 /* osx-project-1-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
841075761657FD59003201D6 /* osx-project-1 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 841075861657FD59003201D6 /* Build configuration list for PBXNativeTarget "osx-project-1" */;
buildPhases = (
841075731657FD59003201D6 /* Sources */,
841075741657FD59003201D6 /* Frameworks */,
841075751657FD59003201D6 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = "osx-project-1";
productName = "osx-project-1";
productReference = 841075771657FD59003201D6 /* osx-project-1 */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
8410756E1657FD59003201D6 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = antonv;
};
buildConfigurationList = 841075711657FD59003201D6 /* Build configuration list for PBXProject "osx-project-1" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 8410756C1657FD59003201D6;
productRefGroup = 841075781657FD59003201D6 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
841075761657FD59003201D6 /* osx-project-1 */,
);
};
/* End PBXProject section */

/* Begin PBXSourcesBuildPhase section */
841075731657FD59003201D6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8410757F1657FD59003201D6 /* main.m in Sources */,
8410758B1657FDB8003201D6 /* Cell.m in Sources */,
8410759216580D7C003201D6 /* Cell+Mutator.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
841075841657FD59003201D6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
841075851657FD59003201D6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
SDKROOT = macosx;
};
name = Release;
};
841075871657FD59003201D6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "osx-project-1/osx-project-1-Prefix.pch";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
841075881657FD59003201D6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "osx-project-1/osx-project-1-Prefix.pch";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
841075711657FD59003201D6 /* Build configuration list for PBXProject "osx-project-1" */ = {
isa = XCConfigurationList;
buildConfigurations = (
841075841657FD59003201D6 /* Debug */,
841075851657FD59003201D6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
841075861657FD59003201D6 /* Build configuration list for PBXNativeTarget "osx-project-1" */ = {
isa = XCConfigurationList;
buildConfigurations = (
841075871657FD59003201D6 /* Debug */,
841075881657FD59003201D6 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 8410756E1657FD59003201D6 /* Project object */;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions osx-project-1/osx-project-1/Cell+Mutator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// Cell+Mutator.h
// osx-project-1
//
// Created by Admin on 11/17/12.
// Copyright (c) 2012 antonv. All rights reserved.
//

#import "Cell.h"

@interface Cell (Mutator)

-(void) mutateAtPos: (int) pos;

-(void) mutate:(int) persent;

@end
56 changes: 56 additions & 0 deletions osx-project-1/osx-project-1/Cell+Mutator.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// Cell+Mutator.m
// osx-project-1
//
// Created by Admin on 11/17/12.
// Copyright (c) 2012 antonv. All rights reserved.
//

#import "Cell+Mutator.h"

@implementation Cell (Mutator)

-(void)mutateAtPos:(int)pos{
uint rnum = arc4random() % 4;
NSString *newStr;
switch (rnum) {
case 0:
newStr = @"A";
break;
case 1:
newStr = @"T";
break;
case 2:
newStr = @"G";
break;
case 3:
newStr = @"C";
break;
default:
break;
}
[self.DNA setObject:newStr atIndexedSubscript:rnum];
}

-(void)mutate:(int)pos{
NSMutableArray *marked = [NSMutableArray array];
for (int i = 0; i< 100; i++) {
[marked addObject:[NSNumber numberWithBool:NO]];
}
int num_marked = 0;
NSMutableString *s_log = [NSMutableString string];
while (num_marked < pos){
int next_to_mark = arc4random()%100;
if ([[marked objectAtIndex: next_to_mark] boolValue])
continue;
else {
[self mutateAtPos:next_to_mark];
[marked replaceObjectAtIndex:next_to_mark withObject:[NSNumber numberWithBool:YES]];
num_marked++;
[s_log appendFormat:@"%i|",next_to_mark];
}
}
NSLog(@"mutated: %@", s_log);
}

@end
17 changes: 17 additions & 0 deletions osx-project-1/osx-project-1/Cell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// Cell.h
// osx-project-1
//
// Created by Admin on 11/17/12.
// Copyright (c) 2012 antonv. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Cell : NSObject

@property (readonly) NSMutableArray *DNA;

-(int)hammingDistance:(Cell*) cell;

@end
Loading