diff --git a/DNA/DNA.xcodeproj/project.pbxproj b/DNA/DNA.xcodeproj/project.pbxproj new file mode 100644 index 00000000..a333af1e --- /dev/null +++ b/DNA/DNA.xcodeproj/project.pbxproj @@ -0,0 +1,255 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 606CEBA21652C87D007BC943 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 606CEBA11652C87D007BC943 /* Foundation.framework */; }; + 606CEBA51652C87D007BC943 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 606CEBA41652C87D007BC943 /* main.m */; }; + 606CEBA91652C87D007BC943 /* DNA.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 606CEBA81652C87D007BC943 /* DNA.1 */; }; + 606CEBB11652C8A1007BC943 /* Cell.m in Sources */ = {isa = PBXBuildFile; fileRef = 606CEBB01652C8A1007BC943 /* Cell.m */; }; + 606CEBB41652CFD8007BC943 /* Cell+mutator.m in Sources */ = {isa = PBXBuildFile; fileRef = 606CEBB31652CFD8007BC943 /* Cell+mutator.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 606CEB9B1652C87D007BC943 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + 606CEBA91652C87D007BC943 /* DNA.1 in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 606CEB9D1652C87D007BC943 /* DNA */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DNA; sourceTree = BUILT_PRODUCTS_DIR; }; + 606CEBA11652C87D007BC943 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 606CEBA41652C87D007BC943 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 606CEBA71652C87D007BC943 /* DNA-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DNA-Prefix.pch"; sourceTree = ""; }; + 606CEBA81652C87D007BC943 /* DNA.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = DNA.1; sourceTree = ""; }; + 606CEBAF1652C8A1007BC943 /* Cell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cell.h; sourceTree = ""; }; + 606CEBB01652C8A1007BC943 /* Cell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cell.m; sourceTree = ""; }; + 606CEBB21652CFD8007BC943 /* Cell+mutator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Cell+mutator.h"; sourceTree = ""; }; + 606CEBB31652CFD8007BC943 /* Cell+mutator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Cell+mutator.m"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 606CEB9A1652C87D007BC943 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 606CEBA21652C87D007BC943 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 606CEB921652C87C007BC943 = { + isa = PBXGroup; + children = ( + 606CEBA31652C87D007BC943 /* DNA */, + 606CEBA01652C87D007BC943 /* Frameworks */, + 606CEB9E1652C87D007BC943 /* Products */, + ); + sourceTree = ""; + }; + 606CEB9E1652C87D007BC943 /* Products */ = { + isa = PBXGroup; + children = ( + 606CEB9D1652C87D007BC943 /* DNA */, + ); + name = Products; + sourceTree = ""; + }; + 606CEBA01652C87D007BC943 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 606CEBA11652C87D007BC943 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 606CEBA31652C87D007BC943 /* DNA */ = { + isa = PBXGroup; + children = ( + 606CEBA41652C87D007BC943 /* main.m */, + 606CEBB21652CFD8007BC943 /* Cell+mutator.h */, + 606CEBB31652CFD8007BC943 /* Cell+mutator.m */, + 606CEBAF1652C8A1007BC943 /* Cell.h */, + 606CEBB01652C8A1007BC943 /* Cell.m */, + 606CEBA81652C87D007BC943 /* DNA.1 */, + 606CEBA61652C87D007BC943 /* Supporting Files */, + ); + path = DNA; + sourceTree = ""; + }; + 606CEBA61652C87D007BC943 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 606CEBA71652C87D007BC943 /* DNA-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 606CEB9C1652C87D007BC943 /* DNA */ = { + isa = PBXNativeTarget; + buildConfigurationList = 606CEBAC1652C87D007BC943 /* Build configuration list for PBXNativeTarget "DNA" */; + buildPhases = ( + 606CEB991652C87D007BC943 /* Sources */, + 606CEB9A1652C87D007BC943 /* Frameworks */, + 606CEB9B1652C87D007BC943 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DNA; + productName = DNA; + productReference = 606CEB9D1652C87D007BC943 /* DNA */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 606CEB941652C87D007BC943 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = "Алексей Потемкин"; + }; + buildConfigurationList = 606CEB971652C87D007BC943 /* Build configuration list for PBXProject "DNA" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 606CEB921652C87C007BC943; + productRefGroup = 606CEB9E1652C87D007BC943 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 606CEB9C1652C87D007BC943 /* DNA */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 606CEB991652C87D007BC943 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 606CEBA51652C87D007BC943 /* main.m in Sources */, + 606CEBB11652C8A1007BC943 /* Cell.m in Sources */, + 606CEBB41652CFD8007BC943 /* Cell+mutator.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 606CEBAA1652C87D007BC943 /* 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; + }; + 606CEBAB1652C87D007BC943 /* 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; + }; + 606CEBAD1652C87D007BC943 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "DNA/DNA-Prefix.pch"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 606CEBAE1652C87D007BC943 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "DNA/DNA-Prefix.pch"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 606CEB971652C87D007BC943 /* Build configuration list for PBXProject "DNA" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 606CEBAA1652C87D007BC943 /* Debug */, + 606CEBAB1652C87D007BC943 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 606CEBAC1652C87D007BC943 /* Build configuration list for PBXNativeTarget "DNA" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 606CEBAD1652C87D007BC943 /* Debug */, + 606CEBAE1652C87D007BC943 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 606CEB941652C87D007BC943 /* Project object */; +} diff --git a/DNA/DNA.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/DNA/DNA.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..f6feef27 --- /dev/null +++ b/DNA/DNA.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/DNA/DNA.xcodeproj/project.xcworkspace/xcshareddata/DNA.xccheckout b/DNA/DNA.xcodeproj/project.xcworkspace/xcshareddata/DNA.xccheckout new file mode 100644 index 00000000..a9c596f2 --- /dev/null +++ b/DNA/DNA.xcodeproj/project.xcworkspace/xcshareddata/DNA.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 03C01933-9C83-4426-85C5-7176BF1F8D4F + IDESourceControlProjectName + DNA + IDESourceControlProjectOriginsDictionary + + 738112EB-DFF8-40DE-826B-43BCAA479693 + https://github.com/potemkinaleksey/osx-project-1.git + + IDESourceControlProjectPath + DNA/DNA.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 738112EB-DFF8-40DE-826B-43BCAA479693 + ../../.. + + IDESourceControlProjectURL + https://github.com/potemkinaleksey/osx-project-1.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + 738112EB-DFF8-40DE-826B-43BCAA479693 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 738112EB-DFF8-40DE-826B-43BCAA479693 + IDESourceControlWCCName + osx-project-1 + + + + diff --git a/DNA/DNA.xcodeproj/project.xcworkspace/xcuserdata/alexp.xcuserdatad/UserInterfaceState.xcuserstate b/DNA/DNA.xcodeproj/project.xcworkspace/xcuserdata/alexp.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..64e4da3d Binary files /dev/null and b/DNA/DNA.xcodeproj/project.xcworkspace/xcuserdata/alexp.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/DNA/DNA.xcodeproj/project.xcworkspace/xcuserdata/ivanrpn.xcuserdatad/UserInterfaceState.xcuserstate b/DNA/DNA.xcodeproj/project.xcworkspace/xcuserdata/ivanrpn.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..f0bd0364 Binary files /dev/null and b/DNA/DNA.xcodeproj/project.xcworkspace/xcuserdata/ivanrpn.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/DNA/DNA.xcodeproj/xcuserdata/alexp.xcuserdatad/xcschemes/DNA.xcscheme b/DNA/DNA.xcodeproj/xcuserdata/alexp.xcuserdatad/xcschemes/DNA.xcscheme new file mode 100644 index 00000000..59617b24 --- /dev/null +++ b/DNA/DNA.xcodeproj/xcuserdata/alexp.xcuserdatad/xcschemes/DNA.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DNA/DNA.xcodeproj/xcuserdata/alexp.xcuserdatad/xcschemes/xcschememanagement.plist b/DNA/DNA.xcodeproj/xcuserdata/alexp.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..a0aecad4 --- /dev/null +++ b/DNA/DNA.xcodeproj/xcuserdata/alexp.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + DNA.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 606CEB9C1652C87D007BC943 + + primary + + + + + diff --git a/DNA/DNA.xcodeproj/xcuserdata/ivanrpn.xcuserdatad/xcschemes/DNA.xcscheme b/DNA/DNA.xcodeproj/xcuserdata/ivanrpn.xcuserdatad/xcschemes/DNA.xcscheme new file mode 100644 index 00000000..ab32f3f5 --- /dev/null +++ b/DNA/DNA.xcodeproj/xcuserdata/ivanrpn.xcuserdatad/xcschemes/DNA.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DNA/DNA.xcodeproj/xcuserdata/ivanrpn.xcuserdatad/xcschemes/xcschememanagement.plist b/DNA/DNA.xcodeproj/xcuserdata/ivanrpn.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..a0aecad4 --- /dev/null +++ b/DNA/DNA.xcodeproj/xcuserdata/ivanrpn.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + DNA.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 606CEB9C1652C87D007BC943 + + primary + + + + + diff --git a/DNA/DNA/Cell+mutator.h b/DNA/DNA/Cell+mutator.h new file mode 100644 index 00000000..55e21f5b --- /dev/null +++ b/DNA/DNA/Cell+mutator.h @@ -0,0 +1,18 @@ +// +// Cell+mutator.h +// DNA +// +// Created by Алексей Потемкин on 13.11.12. +// Copyright (c) 2012 Алексей Потемкин. All rights reserved. +// + +#include + +#import "Cell.h" + + +@interface Cell (mutator) + +-(void)mutate:(int) percent; + +@end diff --git a/DNA/DNA/Cell+mutator.m b/DNA/DNA/Cell+mutator.m new file mode 100644 index 00000000..fb829118 --- /dev/null +++ b/DNA/DNA/Cell+mutator.m @@ -0,0 +1,21 @@ +// +// Cell+mutator.m +// DNA +// +// Created by Алексей Потемкин on 13.11.12. +// Copyright (c) 2012 Алексей Потемкин. All rights reserved. +// + +#import "Cell+mutator.h" + +@implementation Cell (mutator) + +-(void)mutate:(int)percent{ + + for (int i = 0; i < percent; ++i) { + [self.DNA insertObject:[self.characters objectAtIndex:arc4random() % 4] atIndex:i]; + } + +} + +@end diff --git a/DNA/DNA/Cell.h b/DNA/DNA/Cell.h new file mode 100644 index 00000000..d1274bf4 --- /dev/null +++ b/DNA/DNA/Cell.h @@ -0,0 +1,21 @@ +// +// Cell.h +// DNA +// +// Created by Алексей Потемкин on 13.11.12. +// Copyright (c) 2012 Алексей Потемкин. All rights reserved. +// + +#include + +#import + + +@interface Cell : NSObject + +@property (nonatomic, strong) NSMutableArray *DNA; +@property (nonatomic, strong) NSArray *characters; // Characters for DNA array + +-(int)hammingDistance:(Cell *)cell; + +@end diff --git a/DNA/DNA/Cell.m b/DNA/DNA/Cell.m new file mode 100644 index 00000000..2bd553fc --- /dev/null +++ b/DNA/DNA/Cell.m @@ -0,0 +1,50 @@ +// +// Cell.m +// DNA +// +// Created by Алексей Потемкин on 13.11.12. +// Copyright (c) 2012 Алексей Потемкин. All rights reserved. +// + +#import "Cell.h" + +@implementation Cell + +@synthesize DNA = _DNA; +@synthesize characters = _characters; + +-(id)init{ + + self = [super init]; + + if (!self) { + + if (!_DNA) { + _DNA = [[NSMutableArray alloc] init]; + } + + _characters = [[NSArray alloc] initWithObjects:@"A", @"T", @"G", @"C", nil]; + + for (int i = 0; i < 100; ++i) { + [_DNA insertObject:[_characters objectAtIndex:arc4random() % 4] atIndex:i]; + } + + } + + return self; +} + +-(int)hammingDistance:(Cell *)cell{ + + int hammingDistance = 0; + + for (int i = 0; i < [_DNA count]; ++i) { + if (![[_DNA objectAtIndex:i] isEqualTo:[[cell DNA] objectAtIndex:i]]) { + hammingDistance++; + } + } + + return hammingDistance; +} + +@end diff --git a/DNA/DNA/DNA-Prefix.pch b/DNA/DNA/DNA-Prefix.pch new file mode 100644 index 00000000..cd50d540 --- /dev/null +++ b/DNA/DNA/DNA-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'DNA' target in the 'DNA' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/DNA/DNA/DNA.1 b/DNA/DNA/DNA.1 new file mode 100644 index 00000000..f1a89198 --- /dev/null +++ b/DNA/DNA/DNA.1 @@ -0,0 +1,79 @@ +.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. +.\"See Also: +.\"man mdoc.samples for a complete listing of options +.\"man mdoc for the short list of editing options +.\"/usr/share/misc/mdoc.template +.Dd 13.11.12 \" DATE +.Dt DNA 1 \" Program name and manual section number +.Os Darwin +.Sh NAME \" Section Header - required - don't modify +.Nm DNA, +.\" The following lines are read in generating the apropos(man -k) database. Use only key +.\" words here as the database is built based on the words here and in the .ND line. +.Nm Other_name_for_same_program(), +.Nm Yet another name for the same program. +.\" Use .Nm macro to designate other names for the documented program. +.Nd This line parsed for whatis database. +.Sh SYNOPSIS \" Section Header - required - don't modify +.Nm +.Op Fl abcd \" [-abcd] +.Op Fl a Ar path \" [-a path] +.Op Ar file \" [file] +.Op Ar \" [file ...] +.Ar arg0 \" Underlined argument - use .Ar anywhere to underline +arg2 ... \" Arguments +.Sh DESCRIPTION \" Section Header - required - don't modify +Use the .Nm macro to refer to your program throughout the man page like such: +.Nm +Underlining is accomplished with the .Ar macro like this: +.Ar underlined text . +.Pp \" Inserts a space +A list of items with descriptions: +.Bl -tag -width -indent \" Begins a tagged list +.It item a \" Each item preceded by .It macro +Description of item a +.It item b +Description of item b +.El \" Ends the list +.Pp +A list of flags and their descriptions: +.Bl -tag -width -indent \" Differs from above in tag removed +.It Fl a \"-a flag as a list item +Description of -a flag +.It Fl b +Description of -b flag +.El \" Ends the list +.Pp +.\" .Sh ENVIRONMENT \" May not be needed +.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 +.\" .It Ev ENV_VAR_1 +.\" Description of ENV_VAR_1 +.\" .It Ev ENV_VAR_2 +.\" Description of ENV_VAR_2 +.\" .El +.Sh FILES \" File used or created by the topic of the man page +.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact +.It Pa /usr/share/file_name +FILE_1 description +.It Pa /Users/joeuser/Library/really_long_file_name +FILE_2 description +.El \" Ends the list +.\" .Sh DIAGNOSTICS \" May not be needed +.\" .Bl -diag +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .El +.Sh SEE ALSO +.\" List links in ascending order by section, alphabetically within a section. +.\" Please do not reference files that do not exist without filing a bug report +.Xr a 1 , +.Xr b 1 , +.Xr c 1 , +.Xr a 2 , +.Xr b 2 , +.Xr a 3 , +.Xr b 3 +.\" .Sh BUGS \" Document known, unremedied bugs +.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff --git a/DNA/DNA/main.m b/DNA/DNA/main.m new file mode 100644 index 00000000..5d06947e --- /dev/null +++ b/DNA/DNA/main.m @@ -0,0 +1,31 @@ +// +// main.m +// DNA +// +// Created by Алексей Потемкин on 13.11.12. +// Copyright (c) 2012 Алексей Потемкин. All rights reserved. +// + +#import +#import "Cell.h" +#import "Cell+mutator.h" + +int main(int argc, const char * argv[]) +{ + + @autoreleasepool { + + Cell *oneCell = [[Cell alloc] init]; + Cell *anotherCell = [[Cell alloc] init]; + + NSLog(@"Hamming distance before mutation = %d", [oneCell hammingDistance:anotherCell]); + + [oneCell mutate:10]; + [anotherCell mutate:30]; + + NSLog(@"Hamming distance after mutation = %d", [oneCell hammingDistance:anotherCell]); + + } + return 0; +} + diff --git a/README.md b/README.md index 95bf4f65..d4fcc1d9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ osx-project-1 ============= -## Описание задания [(сдать задание)] (https://u.hexlet.org/courses/4/assignments/5) 1. Создайте новое консольное приложение в XCode.