From a846fb892af471fa7a39b8fcb319a2851f193f60 Mon Sep 17 00:00:00 2001 From: IRUSlan92I Date: Mon, 11 Apr 2022 17:28:18 +0300 Subject: [PATCH] First version --- Tic-Tac-ToeTests/Tic-Tac-ToeTests-Info.plist | 22 + Tic-Tac-ToeTests/Tic_Tac_ToeTests.m | 34 ++ Tic-Tac-ToeTests/en.lproj/InfoPlist.strings | 2 + tic-tac-toe.xcodeproj/project.pbxproj | 482 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../UserInterfaceState.xcuserstate | Bin 0 -> 21100 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 5 + .../xcschemes/Tic-Tac-Toe.xcscheme | 96 ++++ .../xcschemes/xcschememanagement.plist | 27 + tic-tac-toe/Base.lproj/MainMenu.xib | 256 ++++++++++ .../AppIcon.appiconset/Contents.json | 58 +++ tic-tac-toe/RIAppDelegate.h | 41 ++ tic-tac-toe/RIAppDelegate.m | 482 ++++++++++++++++++ tic-tac-toe/Tic-Tac-Toe-Info.plist | 34 ++ tic-tac-toe/Tic-Tac-Toe-Prefix.pch | 9 + tic-tac-toe/en.lproj/Credits.rtf | 24 + tic-tac-toe/en.lproj/InfoPlist.strings | 2 + tic-tac-toe/main.m | 14 + 18 files changed, 1595 insertions(+) create mode 100644 Tic-Tac-ToeTests/Tic-Tac-ToeTests-Info.plist create mode 100644 Tic-Tac-ToeTests/Tic_Tac_ToeTests.m create mode 100644 Tic-Tac-ToeTests/en.lproj/InfoPlist.strings create mode 100644 tic-tac-toe.xcodeproj/project.pbxproj create mode 100644 tic-tac-toe.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 tic-tac-toe.xcodeproj/project.xcworkspace/xcuserdata/ruslan.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 tic-tac-toe.xcodeproj/xcuserdata/ruslan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist create mode 100644 tic-tac-toe.xcodeproj/xcuserdata/ruslan.xcuserdatad/xcschemes/Tic-Tac-Toe.xcscheme create mode 100644 tic-tac-toe.xcodeproj/xcuserdata/ruslan.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 tic-tac-toe/Base.lproj/MainMenu.xib create mode 100644 tic-tac-toe/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 tic-tac-toe/RIAppDelegate.h create mode 100644 tic-tac-toe/RIAppDelegate.m create mode 100644 tic-tac-toe/Tic-Tac-Toe-Info.plist create mode 100644 tic-tac-toe/Tic-Tac-Toe-Prefix.pch create mode 100644 tic-tac-toe/en.lproj/Credits.rtf create mode 100644 tic-tac-toe/en.lproj/InfoPlist.strings create mode 100644 tic-tac-toe/main.m diff --git a/Tic-Tac-ToeTests/Tic-Tac-ToeTests-Info.plist b/Tic-Tac-ToeTests/Tic-Tac-ToeTests-Info.plist new file mode 100644 index 0000000..1abbc36 --- /dev/null +++ b/Tic-Tac-ToeTests/Tic-Tac-ToeTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + RUSlan.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Tic-Tac-ToeTests/Tic_Tac_ToeTests.m b/Tic-Tac-ToeTests/Tic_Tac_ToeTests.m new file mode 100644 index 0000000..b159c87 --- /dev/null +++ b/Tic-Tac-ToeTests/Tic_Tac_ToeTests.m @@ -0,0 +1,34 @@ +// +// Tic_Tac_ToeTests.m +// Tic-Tac-ToeTests +// +// Created by RUSlan on 23.03.14. +// Copyright (c) 2014 RUSlan. All rights reserved. +// + +#import + +@interface Tic_Tac_ToeTests : XCTestCase + +@end + +@implementation Tic_Tac_ToeTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/Tic-Tac-ToeTests/en.lproj/InfoPlist.strings b/Tic-Tac-ToeTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Tic-Tac-ToeTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/tic-tac-toe.xcodeproj/project.pbxproj b/tic-tac-toe.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9367875 --- /dev/null +++ b/tic-tac-toe.xcodeproj/project.pbxproj @@ -0,0 +1,482 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 440355F518DF4BA2005D32EA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 440355F418DF4BA2005D32EA /* Cocoa.framework */; }; + 440355FF18DF4BA3005D32EA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 440355FD18DF4BA3005D32EA /* InfoPlist.strings */; }; + 4403560118DF4BA3005D32EA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4403560018DF4BA3005D32EA /* main.m */; }; + 4403560518DF4BA3005D32EA /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 4403560318DF4BA3005D32EA /* Credits.rtf */; }; + 4403560818DF4BA3005D32EA /* RIAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4403560718DF4BA3005D32EA /* RIAppDelegate.m */; }; + 4403560B18DF4BA3005D32EA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4403560918DF4BA3005D32EA /* MainMenu.xib */; }; + 4403560D18DF4BA3005D32EA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4403560C18DF4BA3005D32EA /* Images.xcassets */; }; + 4403561418DF4BA3005D32EA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4403561318DF4BA3005D32EA /* XCTest.framework */; }; + 4403561518DF4BA3005D32EA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 440355F418DF4BA2005D32EA /* Cocoa.framework */; }; + 4403561D18DF4BA3005D32EA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4403561B18DF4BA3005D32EA /* InfoPlist.strings */; }; + 4403561F18DF4BA3005D32EA /* Tic_Tac_ToeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4403561E18DF4BA3005D32EA /* Tic_Tac_ToeTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 4403561618DF4BA3005D32EA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 440355E918DF4BA2005D32EA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 440355F018DF4BA2005D32EA; + remoteInfo = "Tic-Tac-Toe"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 440355F118DF4BA2005D32EA /* Tic-Tac-Toe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tic-Tac-Toe.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 440355F418DF4BA2005D32EA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 440355F718DF4BA3005D32EA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 440355F818DF4BA3005D32EA /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 440355F918DF4BA3005D32EA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 440355FC18DF4BA3005D32EA /* Tic-Tac-Toe-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tic-Tac-Toe-Info.plist"; sourceTree = ""; }; + 440355FE18DF4BA3005D32EA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 4403560018DF4BA3005D32EA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 4403560218DF4BA3005D32EA /* Tic-Tac-Toe-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tic-Tac-Toe-Prefix.pch"; sourceTree = ""; }; + 4403560418DF4BA3005D32EA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + 4403560618DF4BA3005D32EA /* RIAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RIAppDelegate.h; sourceTree = ""; }; + 4403560718DF4BA3005D32EA /* RIAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RIAppDelegate.m; sourceTree = ""; }; + 4403560A18DF4BA3005D32EA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 4403560C18DF4BA3005D32EA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 4403561218DF4BA3005D32EA /* Tic-Tac-ToeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tic-Tac-ToeTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 4403561318DF4BA3005D32EA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 4403561A18DF4BA3005D32EA /* Tic-Tac-ToeTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tic-Tac-ToeTests-Info.plist"; sourceTree = ""; }; + 4403561C18DF4BA3005D32EA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 4403561E18DF4BA3005D32EA /* Tic_Tac_ToeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tic_Tac_ToeTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 440355EE18DF4BA2005D32EA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 440355F518DF4BA2005D32EA /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4403560F18DF4BA3005D32EA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4403561518DF4BA3005D32EA /* Cocoa.framework in Frameworks */, + 4403561418DF4BA3005D32EA /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 440355E818DF4BA2005D32EA = { + isa = PBXGroup; + children = ( + 440355FA18DF4BA3005D32EA /* Tic-Tac-Toe */, + 4403561818DF4BA3005D32EA /* Tic-Tac-ToeTests */, + 440355F318DF4BA2005D32EA /* Frameworks */, + 440355F218DF4BA2005D32EA /* Products */, + ); + sourceTree = ""; + }; + 440355F218DF4BA2005D32EA /* Products */ = { + isa = PBXGroup; + children = ( + 440355F118DF4BA2005D32EA /* Tic-Tac-Toe.app */, + 4403561218DF4BA3005D32EA /* Tic-Tac-ToeTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 440355F318DF4BA2005D32EA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 440355F418DF4BA2005D32EA /* Cocoa.framework */, + 4403561318DF4BA3005D32EA /* XCTest.framework */, + 440355F618DF4BA3005D32EA /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 440355F618DF4BA3005D32EA /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 440355F718DF4BA3005D32EA /* AppKit.framework */, + 440355F818DF4BA3005D32EA /* CoreData.framework */, + 440355F918DF4BA3005D32EA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 440355FA18DF4BA3005D32EA /* Tic-Tac-Toe */ = { + isa = PBXGroup; + children = ( + 4403560618DF4BA3005D32EA /* RIAppDelegate.h */, + 4403560718DF4BA3005D32EA /* RIAppDelegate.m */, + 4403560918DF4BA3005D32EA /* MainMenu.xib */, + 4403560C18DF4BA3005D32EA /* Images.xcassets */, + 440355FB18DF4BA3005D32EA /* Supporting Files */, + ); + path = "Tic-Tac-Toe"; + sourceTree = ""; + }; + 440355FB18DF4BA3005D32EA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 440355FC18DF4BA3005D32EA /* Tic-Tac-Toe-Info.plist */, + 440355FD18DF4BA3005D32EA /* InfoPlist.strings */, + 4403560018DF4BA3005D32EA /* main.m */, + 4403560218DF4BA3005D32EA /* Tic-Tac-Toe-Prefix.pch */, + 4403560318DF4BA3005D32EA /* Credits.rtf */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 4403561818DF4BA3005D32EA /* Tic-Tac-ToeTests */ = { + isa = PBXGroup; + children = ( + 4403561E18DF4BA3005D32EA /* Tic_Tac_ToeTests.m */, + 4403561918DF4BA3005D32EA /* Supporting Files */, + ); + path = "Tic-Tac-ToeTests"; + sourceTree = ""; + }; + 4403561918DF4BA3005D32EA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 4403561A18DF4BA3005D32EA /* Tic-Tac-ToeTests-Info.plist */, + 4403561B18DF4BA3005D32EA /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 440355F018DF4BA2005D32EA /* Tic-Tac-Toe */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4403562218DF4BA3005D32EA /* Build configuration list for PBXNativeTarget "Tic-Tac-Toe" */; + buildPhases = ( + 440355ED18DF4BA2005D32EA /* Sources */, + 440355EE18DF4BA2005D32EA /* Frameworks */, + 440355EF18DF4BA2005D32EA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Tic-Tac-Toe"; + productName = "Tic-Tac-Toe"; + productReference = 440355F118DF4BA2005D32EA /* Tic-Tac-Toe.app */; + productType = "com.apple.product-type.application"; + }; + 4403561118DF4BA3005D32EA /* Tic-Tac-ToeTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4403562518DF4BA3005D32EA /* Build configuration list for PBXNativeTarget "Tic-Tac-ToeTests" */; + buildPhases = ( + 4403560E18DF4BA3005D32EA /* Sources */, + 4403560F18DF4BA3005D32EA /* Frameworks */, + 4403561018DF4BA3005D32EA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 4403561718DF4BA3005D32EA /* PBXTargetDependency */, + ); + name = "Tic-Tac-ToeTests"; + productName = "Tic-Tac-ToeTests"; + productReference = 4403561218DF4BA3005D32EA /* Tic-Tac-ToeTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 440355E918DF4BA2005D32EA /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = RI; + LastUpgradeCheck = 0510; + ORGANIZATIONNAME = RUSlan; + TargetAttributes = { + 4403561118DF4BA3005D32EA = { + TestTargetID = 440355F018DF4BA2005D32EA; + }; + }; + }; + buildConfigurationList = 440355EC18DF4BA2005D32EA /* Build configuration list for PBXProject "Tic-Tac-Toe" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 440355E818DF4BA2005D32EA; + productRefGroup = 440355F218DF4BA2005D32EA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 440355F018DF4BA2005D32EA /* Tic-Tac-Toe */, + 4403561118DF4BA3005D32EA /* Tic-Tac-ToeTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 440355EF18DF4BA2005D32EA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 440355FF18DF4BA3005D32EA /* InfoPlist.strings in Resources */, + 4403560D18DF4BA3005D32EA /* Images.xcassets in Resources */, + 4403560518DF4BA3005D32EA /* Credits.rtf in Resources */, + 4403560B18DF4BA3005D32EA /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4403561018DF4BA3005D32EA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4403561D18DF4BA3005D32EA /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 440355ED18DF4BA2005D32EA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4403560118DF4BA3005D32EA /* main.m in Sources */, + 4403560818DF4BA3005D32EA /* RIAppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4403560E18DF4BA3005D32EA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4403561F18DF4BA3005D32EA /* Tic_Tac_ToeTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 4403561718DF4BA3005D32EA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 440355F018DF4BA2005D32EA /* Tic-Tac-Toe */; + targetProxy = 4403561618DF4BA3005D32EA /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 440355FD18DF4BA3005D32EA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 440355FE18DF4BA3005D32EA /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 4403560318DF4BA3005D32EA /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 4403560418DF4BA3005D32EA /* en */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + 4403560918DF4BA3005D32EA /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 4403560A18DF4BA3005D32EA /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + 4403561B18DF4BA3005D32EA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 4403561C18DF4BA3005D32EA /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4403562018DF4BA3005D32EA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + 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_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 4403562118DF4BA3005D32EA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + SDKROOT = macosx; + }; + name = Release; + }; + 4403562318DF4BA3005D32EA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tic-Tac-Toe/Tic-Tac-Toe-Prefix.pch"; + INFOPLIST_FILE = "Tic-Tac-Toe/Tic-Tac-Toe-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 4403562418DF4BA3005D32EA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tic-Tac-Toe/Tic-Tac-Toe-Prefix.pch"; + INFOPLIST_FILE = "Tic-Tac-Toe/Tic-Tac-Toe-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 4403562618DF4BA3005D32EA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Tic-Tac-Toe.app/Contents/MacOS/Tic-Tac-Toe"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tic-Tac-Toe/Tic-Tac-Toe-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Tic-Tac-ToeTests/Tic-Tac-ToeTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 4403562718DF4BA3005D32EA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Tic-Tac-Toe.app/Contents/MacOS/Tic-Tac-Toe"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tic-Tac-Toe/Tic-Tac-Toe-Prefix.pch"; + INFOPLIST_FILE = "Tic-Tac-ToeTests/Tic-Tac-ToeTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 440355EC18DF4BA2005D32EA /* Build configuration list for PBXProject "Tic-Tac-Toe" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4403562018DF4BA3005D32EA /* Debug */, + 4403562118DF4BA3005D32EA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4403562218DF4BA3005D32EA /* Build configuration list for PBXNativeTarget "Tic-Tac-Toe" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4403562318DF4BA3005D32EA /* Debug */, + 4403562418DF4BA3005D32EA /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 4403562518DF4BA3005D32EA /* Build configuration list for PBXNativeTarget "Tic-Tac-ToeTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4403562618DF4BA3005D32EA /* Debug */, + 4403562718DF4BA3005D32EA /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 440355E918DF4BA2005D32EA /* Project object */; +} diff --git a/tic-tac-toe.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/tic-tac-toe.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..558934b --- /dev/null +++ b/tic-tac-toe.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/tic-tac-toe.xcodeproj/project.xcworkspace/xcuserdata/ruslan.xcuserdatad/UserInterfaceState.xcuserstate b/tic-tac-toe.xcodeproj/project.xcworkspace/xcuserdata/ruslan.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..82bf3913382209d44d007b9deaf91316f1cd082e GIT binary patch literal 21100 zcmYc)$jK}&F)+Boz{tSFz|6qHz{*x?3?dAo44MpD4B8Aj47v<@4EhWP42BFw3}y^A z3_%RR3?U4m3}Fo63=s^G3{ecx3^5F`45bWZ4CM?J43!L34Al%Z47Ch(4D}4%3_T3J z41Em!46_;LFwA9`$1tB^0mDLuB@8PV)-kMS*ub!jVLQVfh9e9|8ICa=XE?!dis2H& zWriyZ*BS0I++%pc@RZ>_!v}_s44)XjF>)|+GIB9;Gx9LVv7*8{vVLZ!t zj`2L>1;&evcNy<7-e-Kk_>l1_<1@y0jPDsgFn(eD!NkJE%EZRR&cwmQ$;8FP$0Wog z!6eJ1%%sAk%B0Pt!=%e($YjK1%w)o3%4Er8%Vfvo!Q{gf#}v<$%aq5I&s4xv$W+8s z%2dWw&Q!rv$JD~q!PLpr%hbm-iD@#^bfy_hGnr;F&0|``w3ul*(|V?zO#7LRGM!{P z%XE?H64N!N+e{Cbo-(~;de8Kg=@&BtGaEA(Gas`Evm~=3vl6p1vo^C1vjwvyvlX*7 zvkkKkvoEtBvp;hHb0BjNa|ClFb3Ahba|UxJb3Su1a|v@5a|3f5a}V<@=Gn}1nCCLj zW1i3SmU#j5LgwwvJD7Je?_%D~yoY%&^FHSN%mGdVliehVKHSf zW3gdzU~y#eX9-{lWC>ykW(i@5V2NZ&WJzL4W=UtsW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file mode 100644 index 0000000..42bab3e --- /dev/null +++ b/tic-tac-toe.xcodeproj/xcuserdata/ruslan.xcuserdatad/xcschemes/Tic-Tac-Toe.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tic-tac-toe.xcodeproj/xcuserdata/ruslan.xcuserdatad/xcschemes/xcschememanagement.plist b/tic-tac-toe.xcodeproj/xcuserdata/ruslan.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..9785c2f --- /dev/null +++ b/tic-tac-toe.xcodeproj/xcuserdata/ruslan.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Tic-Tac-Toe.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 440355F018DF4BA2005D32EA + + primary + + + 4403561118DF4BA3005D32EA + + primary + + + + + diff --git a/tic-tac-toe/Base.lproj/MainMenu.xib b/tic-tac-toe/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..490d29c --- /dev/null +++ b/tic-tac-toe/Base.lproj/MainMenu.xib @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + X + O + Dual + + + + + + + + + + + diff --git a/tic-tac-toe/Images.xcassets/AppIcon.appiconset/Contents.json b/tic-tac-toe/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/tic-tac-toe/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/tic-tac-toe/RIAppDelegate.h b/tic-tac-toe/RIAppDelegate.h new file mode 100644 index 0000000..640214f --- /dev/null +++ b/tic-tac-toe/RIAppDelegate.h @@ -0,0 +1,41 @@ +// +// RIAppDelegate.h +// Tic-Tac-Toe +// +// Created by RUSlan on 23.03.14. +// Copyright (c) 2014 RUSlan. All rights reserved. +// + +#import + +@interface RIAppDelegate : NSObject + +@property (assign) IBOutlet NSWindow *window; + + +- (IBAction)NewGame:(id)sender; + +- (IBAction)ClickMatrix:(id)sender; + +- (IBAction)Checking; + +- (IBAction)CheckingDraw; + +- (IBAction)FirstMoveChange:(id)sender; + +- (IBAction)StatsUpdate:(id)sender; + +@property (weak) IBOutlet NSMatrix *Buttons; +@property (weak) IBOutlet NSTextField *Text; +@property (weak) IBOutlet NSMatrix *Stats; +@property (weak) IBOutlet NSButton *FirstMoveMenu; +@property (weak) IBOutlet NSComboBox *ButtonChangeFirstMove; + +bool cellEq(id array, int firstRow, int firstColumn, int secondRow, int secondColumn); + +void computerMv(id array, id Text); + +void changeXO(); + + +@end diff --git a/tic-tac-toe/RIAppDelegate.m b/tic-tac-toe/RIAppDelegate.m new file mode 100644 index 0000000..731c3f9 --- /dev/null +++ b/tic-tac-toe/RIAppDelegate.m @@ -0,0 +1,482 @@ +// +// RIAppDelegate.m +// Tic-Tac-Toe +// +// Created by RUSlan on 23.03.14. +// Copyright (c) 2014 RUSlan. All rights reserved. +// + +#import "RIAppDelegate.h" + + +NSString *playerMove; +NSString *computerMove; +NSString *player1Move; +NSString *player2Move; + +bool gameWasEnded; +bool computerPlaysFirst; +bool firstPlayerMove; +bool twoPlayerMode; + +NSInteger wins; +NSInteger loses; +NSInteger draws; +NSInteger player1Wins; +NSInteger player2Wins; +NSInteger dualDraws; + + +@implementation RIAppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + playerMove = [NSString new]; + computerMove = [NSString new]; + player1Move = [NSString new]; + player2Move = [NSString new]; + + player1Move = @"X"; + player2Move = @"O"; + + + gameWasEnded = false; + + wins = 0; + loses = 0; + draws = 0; + player1Wins = 0; + player2Wins = 0; + dualDraws = 0; + + [_ButtonChangeFirstMove selectItemAtIndex: 0]; + [self FirstMoveChange: NULL]; + + [self NewGame: NULL]; +} + +- (IBAction)NewGame:(id)sender { + [_Text setStringValue: @"New Game"]; + + firstPlayerMove = true; + + [_ButtonChangeFirstMove setEnabled: true]; + + [self StatsUpdate: NULL]; + gameWasEnded = false; + + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + [[_Buttons cellAtRow: i column: j] setTitle: @""]; + } + } + if (computerPlaysFirst) { + computerMv(_Buttons, _Text); + } +} + +- (IBAction)ClickMatrix:(id)sender { + + if (gameWasEnded) { + [self NewGame: NULL]; + } + else { + [_Text setStringValue: @""]; + + [_ButtonChangeFirstMove setEnabled: false]; + + if ([[[sender selectedCell] title] compare: @""]) { + [_Text setStringValue: @"Illegal move!"]; + } + else { + [self Checking]; + if (!gameWasEnded) { + [self CheckingDraw]; + } + if (twoPlayerMode) { + [[sender selectedCell] setTitle: (firstPlayerMove) ? player1Move : player2Move]; + [self Checking]; + if (!gameWasEnded) { + [self CheckingDraw]; + } + firstPlayerMove = !firstPlayerMove; + } + else { + [[sender selectedCell] setTitle: playerMove]; + [self Checking]; + if (!gameWasEnded) { + [self CheckingDraw]; + } + if (!gameWasEnded) { + computerMv(sender, _Text); + [self Checking]; + if (!gameWasEnded) { + [self CheckingDraw]; + } + } + } + } + } +} + +- (IBAction)Checking { + if ( (cellEq(_Buttons, 0, 0, 1, 1) && cellEq(_Buttons, 0, 0, 2, 2)) || + (cellEq(_Buttons, 0, 2, 1, 1) && cellEq(_Buttons, 0, 2, 2, 0)) ) { + if (twoPlayerMode) { + if ([[_Buttons cellAtRow: 1 column: 1] title] == player1Move) { + [_Text setStringValue: @"Player 1 won!"]; + player1Wins++; + } + else { + [_Text setStringValue: @"Player 2 won!"]; + player2Wins++; + } + } + else { + if ([[_Buttons cellAtRow: 1 column: 1] title] == playerMove) { + [_Text setStringValue: @"Player won!"]; + wins++; + } + else { + [_Text setStringValue: @"Computer won!"]; + loses++; + } + } + gameWasEnded = true; + } + for (int i = 0; i < 3; i++) { + if ( cellEq(_Buttons, 0, i, 1, i) && cellEq(_Buttons, 0, i, 2, i) ) { + if (twoPlayerMode) { + if ([[_Buttons cellAtRow: 0 column: i] title] == player1Move) { + [_Text setStringValue: @"Player 1 won!"]; + player1Wins++; + } + else { + [_Text setStringValue: @"Player 2 won!"]; + player2Wins++; + } + } + else { + if ([[_Buttons cellAtRow: 0 column: i] title] == playerMove) { + [_Text setStringValue: @"Player won!"]; + wins++; + } + else { + [_Text setStringValue: @"Computer won!"]; + loses++; + } + + } + gameWasEnded = true; + break; + } + if ( cellEq(_Buttons, i, 0, i, 1) && cellEq(_Buttons, i, 0, i, 2) ) { + if (twoPlayerMode) { + if ([[_Buttons cellAtRow: i column: 0] title] == player1Move) { + [_Text setStringValue: @"Player 1 won!"]; + player1Wins++; + } + else { + [_Text setStringValue: @"Player 2 won!"]; + player2Wins++; + } + } + else { + if ([[_Buttons cellAtRow: i column: 0] title] == playerMove) { + [_Text setStringValue: @"Player won!"]; + wins++; + } + else { + [_Text setStringValue: @"Computer won!"]; + loses++; + } + } + gameWasEnded = true; + break; + } + } +} + +- (IBAction)CheckingDraw { + bool full = true; + + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + full = full && ![[[_Buttons cellAtRow: i column: j] title] isEqual: @""]; + } + } + + if (full) { + [_Text setStringValue: @"Draw!"]; + gameWasEnded = true; + if (twoPlayerMode) { + dualDraws++; + } + else { + draws++; + } + } +} + +- (IBAction)FirstMoveChange:(id)sender { + + switch ([_ButtonChangeFirstMove indexOfSelectedItem]) { + case 0: + computerPlaysFirst = false; + twoPlayerMode = false; + break; + case 1: + computerPlaysFirst = true; + twoPlayerMode = false; + break; + case 2: + computerPlaysFirst = false; + twoPlayerMode = true; + firstPlayerMove = true; + break; + } + changeXO(); + + [self NewGame: NULL]; + [self StatsUpdate: NULL]; +} + +- (IBAction)StatsUpdate:(id)sender { + NSInteger percentW; + NSInteger percentL; + NSInteger games; + if (twoPlayerMode) { + games = wins + loses + draws; + + if (games) { + percentW = round( ((double)wins)/(games) * 100 ); + percentL = round( ((double)loses)/(games) * 100 ); + } + else { + percentW = 0; + percentL = 0; + } + [[_Stats cellAtRow: 0 column: 0] setStringValue: @"P1 wins:"]; + [[_Stats cellAtRow: 1 column: 0] setStringValue: @"P2 wins:"]; + [[_Stats cellAtRow: 2 column: 0] setStringValue: @"Draws:"]; + [[_Stats cellAtRow: 3 column: 0] setStringValue: @"P1 Win rate:"]; + [[_Stats cellAtRow: 4 column: 0] setStringValue: @"P2 Win rate:"]; + + [[_Stats cellAtRow: 0 column: 1] setIntegerValue: player1Wins]; + [[_Stats cellAtRow: 1 column: 1] setIntegerValue: player2Wins]; + [[_Stats cellAtRow: 2 column: 1] setIntegerValue: dualDraws]; + [[_Stats cellAtRow: 3 column: 1] setStringValue: + [NSString stringWithFormat: @"%ld%c", (long)percentW, '%']]; + [[_Stats cellAtRow: 4 column: 1] setStringValue: + [NSString stringWithFormat: @"%ld%c", (long)percentL, '%']]; + } + else { + games = wins + loses + draws; + + if (games) { + percentW = round( ((double)wins)/(games) * 100 ); + percentL = round( ((double)loses)/(games) * 100 ); + } + else { + percentW = 0; + percentL = 0; + } + [[_Stats cellAtRow: 0 column: 0] setStringValue: @"Wins:"]; + [[_Stats cellAtRow: 1 column: 0] setStringValue: @"Loses:"]; + [[_Stats cellAtRow: 2 column: 0] setStringValue: @"Draws:"]; + [[_Stats cellAtRow: 3 column: 0] setStringValue: @"Win rate:"]; + [[_Stats cellAtRow: 4 column: 0] setStringValue: @"Lose rate:"]; + + + [[_Stats cellAtRow: 0 column: 1] setIntegerValue: wins]; + [[_Stats cellAtRow: 1 column: 1] setIntegerValue: loses]; + [[_Stats cellAtRow: 2 column: 1] setIntegerValue: draws]; + [[_Stats cellAtRow: 3 column: 1] setStringValue: + [NSString stringWithFormat: @"%ld%c", (long)percentW, '%']]; + [[_Stats cellAtRow: 4 column: 1] setStringValue: + [NSString stringWithFormat: @"%ld%c", (long)percentL, '%']]; + } +} + + +bool cellEq(id array, int firstRow, int firstColumn, int secondRow, int secondColumn) { + + if (![[[array cellAtRow: firstRow column: firstColumn] title] isEqual: @""]) { + if ([[array cellAtRow: firstRow column: firstColumn] title] == + [[array cellAtRow: secondRow column: secondColumn] title]) { + return true; + } + else { + return false; + } + } + else { + return false; + } +} + +void computerMv(id array, id Text) { + + id cellC = NULL; + id cellP = NULL; + + for (int i = 0; i < 3; i++) { + if ((cellEq(array, i, 0, i, 1)) && + ([[[array cellAtRow: i column: 2] title] isEqual: @""])) + { + if ([[[array cellAtRow: i column: 0] title] isEqual: computerMove]) { + cellC = [array cellAtRow: i column: 2]; + } + else { + cellP = [array cellAtRow: i column: 2]; + } + break; + } + else if ((cellEq(array, i, 0, i, 2)) && + ([[[array cellAtRow: i column: 1] title] isEqual: @""])) + { + if (([[[array cellAtRow: i column: 0] title] isEqual: computerMove])) { + cellC = [array cellAtRow: i column: 1]; + } + else { + cellP = [array cellAtRow: i column: 1]; + } + break; + } + else if ((cellEq(array, i, 2, i, 1)) && + ([[[array cellAtRow: i column: 0] title] isEqual: @""])) + { + if ([[[array cellAtRow: i column: 1] title] isEqual: computerMove]) { + cellC = [array cellAtRow: i column: 0]; + } + else { + cellP = [array cellAtRow: i column: 0]; + } + break; + } + } + for (int i = 0; i < 3; i++) { + if ((cellEq(array, 0, i, 1, i)) && + ([[[array cellAtRow: 2 column: i] title] isEqual: @""])) + { + if ([[[array cellAtRow: 0 column: i] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 2 column: i]; + } + else { + cellP = [array cellAtRow: 2 column: i]; + } + break; + } + else if ((cellEq(array, 0, i, 2, i)) && + ([[[array cellAtRow: 1 column: i] title] isEqual: @""])) + { + if ([[[array cellAtRow: 0 column: i] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 1 column: i]; + } + else { + cellP = [array cellAtRow: 1 column: i]; + } + break; + } + else if ((cellEq(array, 2, i, 1, i)) && + ([[[array cellAtRow: 0 column: i] title] isEqual: @""])) + { + if ([[[array cellAtRow: 2 column: i] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 0 column: i]; + } + else { + cellP = [array cellAtRow: 0 column: i]; + } + break; + } + } + + if ((cellEq(array, 0, 0, 1, 1)) && + ([[[array cellAtRow: 2 column: 2] title] isEqual: @""])) + { + if ([[[array cellAtRow: 0 column: 0] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 2 column: 2]; + } + else { + cellP = [array cellAtRow: 2 column: 2]; + } + } + else if ((cellEq(array, 0, 0, 2, 2)) && + ([[[array cellAtRow: 1 column: 1] title] isEqual: @""])) + { + if ([[[array cellAtRow: 0 column: 0] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 1 column: 1]; + } + else { + cellP = [array cellAtRow: 1 column: 1]; + } + } + else if ((cellEq(array, 2, 2, 1, 1)) && + ([[[array cellAtRow: 0 column: 0] title] isEqual: @""])) + { + if ([[[array cellAtRow: 2 column: 2] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 0 column: 0]; + } + else { + cellP = [array cellAtRow: 0 column: 0]; + } + } + else if ((cellEq(array, 0, 2, 1, 1)) && + ([[[array cellAtRow: 2 column: 0] title] isEqual: @""])) + { + if ([[[array cellAtRow: 0 column: 2] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 2 column: 0]; + } + else { + cellP = [array cellAtRow: 2 column: 0]; + } + } + else if ((cellEq(array, 2, 0, 0, 2)) && + ([[[array cellAtRow: 1 column: 1] title] isEqual: @""])) + { + if ([[[array cellAtRow: 0 column: 2] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 1 column: 1]; + } + else { + cellP = [array cellAtRow: 1 column: 1]; + } + } + else if ((cellEq(array, 2, 0, 1, 1)) && + ([[[array cellAtRow: 0 column: 2] title] isEqual: @""])) + { + if ([[[array cellAtRow: 1 column: 1] title] isEqual: computerMove]) { + cellC = [array cellAtRow: 0 column: 2]; + } + else { + cellP = [array cellAtRow: 0 column: 2]; + } + } + + if (cellC) { + [cellC setTitle: computerMove]; + } + else if (cellP) { + [cellP setTitle: computerMove]; + } + else { + while (true) { + int i = random() % 3; + int j = random() % 3; + + if ([[[array cellAtRow: i column: j] title] isEqualToString: @""]) { + [[array cellAtRow: i column: j] setTitle: computerMove]; + return; + } + } + } +} + + +void changeXO() +{ + playerMove = (computerPlaysFirst) ? @"O" : @"X"; + computerMove = (computerPlaysFirst) ? @"X" : @"O"; +} + +@end + diff --git a/tic-tac-toe/Tic-Tac-Toe-Info.plist b/tic-tac-toe/Tic-Tac-Toe-Info.plist new file mode 100644 index 0000000..fe457a1 --- /dev/null +++ b/tic-tac-toe/Tic-Tac-Toe-Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + RUSlan.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2014 RUSlan. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/tic-tac-toe/Tic-Tac-Toe-Prefix.pch b/tic-tac-toe/Tic-Tac-Toe-Prefix.pch new file mode 100644 index 0000000..35d7640 --- /dev/null +++ b/tic-tac-toe/Tic-Tac-Toe-Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/tic-tac-toe/en.lproj/Credits.rtf b/tic-tac-toe/en.lproj/Credits.rtf new file mode 100644 index 0000000..cb604f6 --- /dev/null +++ b/tic-tac-toe/en.lproj/Credits.rtf @@ -0,0 +1,24 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf190 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw11900\paperh16840\vieww9600\viewh8400\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 + +\f0\b\fs24 \cf0 UserInterface: +\b0 \ + RUSlan\ +\ + +\b Game logic: +\b0 \ + RUSlan\ +\ + +\b Bugs: +\b0 \ + Gaidjin-kun\ +\ + +\b Testers: +\b0 \ + Gaidjin-kun} \ No newline at end of file diff --git a/tic-tac-toe/en.lproj/InfoPlist.strings b/tic-tac-toe/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/tic-tac-toe/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/tic-tac-toe/main.m b/tic-tac-toe/main.m new file mode 100644 index 0000000..4795270 --- /dev/null +++ b/tic-tac-toe/main.m @@ -0,0 +1,14 @@ +// +// main.m +// Tic-Tac-Toe +// +// Created by RUSlan on 23.03.14. +// Copyright (c) 2014 RUSlan. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) +{ + return NSApplicationMain(argc, argv); +}