First version
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>RUSlan.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -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 <XCTest/XCTest.h>
|
||||
|
||||
@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
|
||||
@@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
@@ -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 = "<group>"; };
|
||||
440355FE18DF4BA3005D32EA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
4403560018DF4BA3005D32EA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
4403560218DF4BA3005D32EA /* Tic-Tac-Toe-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tic-Tac-Toe-Prefix.pch"; sourceTree = "<group>"; };
|
||||
4403560418DF4BA3005D32EA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
|
||||
4403560618DF4BA3005D32EA /* RIAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RIAppDelegate.h; sourceTree = "<group>"; };
|
||||
4403560718DF4BA3005D32EA /* RIAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RIAppDelegate.m; sourceTree = "<group>"; };
|
||||
4403560A18DF4BA3005D32EA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
4403560C18DF4BA3005D32EA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
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 = "<group>"; };
|
||||
4403561C18DF4BA3005D32EA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
4403561E18DF4BA3005D32EA /* Tic_Tac_ToeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tic_Tac_ToeTests.m; sourceTree = "<group>"; };
|
||||
/* 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 = "<group>";
|
||||
};
|
||||
440355F218DF4BA2005D32EA /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
440355F118DF4BA2005D32EA /* Tic-Tac-Toe.app */,
|
||||
4403561218DF4BA3005D32EA /* Tic-Tac-ToeTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
440355F318DF4BA2005D32EA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
440355F418DF4BA2005D32EA /* Cocoa.framework */,
|
||||
4403561318DF4BA3005D32EA /* XCTest.framework */,
|
||||
440355F618DF4BA3005D32EA /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
440355F618DF4BA3005D32EA /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
440355F718DF4BA3005D32EA /* AppKit.framework */,
|
||||
440355F818DF4BA3005D32EA /* CoreData.framework */,
|
||||
440355F918DF4BA3005D32EA /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
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 = "<group>";
|
||||
};
|
||||
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 = "<group>";
|
||||
};
|
||||
4403561818DF4BA3005D32EA /* Tic-Tac-ToeTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4403561E18DF4BA3005D32EA /* Tic_Tac_ToeTests.m */,
|
||||
4403561918DF4BA3005D32EA /* Supporting Files */,
|
||||
);
|
||||
path = "Tic-Tac-ToeTests";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4403561918DF4BA3005D32EA /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4403561A18DF4BA3005D32EA /* Tic-Tac-ToeTests-Info.plist */,
|
||||
4403561B18DF4BA3005D32EA /* InfoPlist.strings */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* 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 = "<group>";
|
||||
};
|
||||
4403560318DF4BA3005D32EA /* Credits.rtf */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
4403560418DF4BA3005D32EA /* en */,
|
||||
);
|
||||
name = Credits.rtf;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4403560918DF4BA3005D32EA /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
4403560A18DF4BA3005D32EA /* Base */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4403561B18DF4BA3005D32EA /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
4403561C18DF4BA3005D32EA /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* 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 */;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Tic-Tac-Toe.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
BIN
Binary file not shown.
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
type = "1"
|
||||
version = "2.0">
|
||||
</Bucket>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "440355F018DF4BA2005D32EA"
|
||||
BuildableName = "Tic-Tac-Toe.app"
|
||||
BlueprintName = "Tic-Tac-Toe"
|
||||
ReferencedContainer = "container:Tic-Tac-Toe.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "4403561118DF4BA3005D32EA"
|
||||
BuildableName = "Tic-Tac-ToeTests.xctest"
|
||||
BlueprintName = "Tic-Tac-ToeTests"
|
||||
ReferencedContainer = "container:Tic-Tac-Toe.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "440355F018DF4BA2005D32EA"
|
||||
BuildableName = "Tic-Tac-Toe.app"
|
||||
BlueprintName = "Tic-Tac-Toe"
|
||||
ReferencedContainer = "container:Tic-Tac-Toe.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "440355F018DF4BA2005D32EA"
|
||||
BuildableName = "Tic-Tac-Toe.app"
|
||||
BlueprintName = "Tic-Tac-Toe"
|
||||
ReferencedContainer = "container:Tic-Tac-Toe.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "440355F018DF4BA2005D32EA"
|
||||
BuildableName = "Tic-Tac-Toe.app"
|
||||
BlueprintName = "Tic-Tac-Toe"
|
||||
ReferencedContainer = "container:Tic-Tac-Toe.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Tic-Tac-Toe.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>440355F018DF4BA2005D32EA</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>4403561118DF4BA3005D32EA</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,256 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5053"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<customObject id="Voe-Tx-rLC" customClass="RIAppDelegate">
|
||||
<connections>
|
||||
<outlet property="ButtonChangeFirstMove" destination="AM8-Hm-CgG" id="4OL-m1-Cfx"/>
|
||||
<outlet property="Buttons" destination="mAE-IZ-FuB" id="QYp-6X-XEj"/>
|
||||
<outlet property="Stats" destination="ouk-dN-F1c" id="PA3-It-SiQ"/>
|
||||
<outlet property="Text" destination="YyX-02-yoo" id="X2S-L1-i13"/>
|
||||
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="Tic-Tac-Toe" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Tic-Tac-Toe" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About Tic-Tac-Toe" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
|
||||
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
|
||||
<menuItem title="Hide Tic-Tac-Toe" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit Tic-Tac-Toe" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="dMs-cI-mzQ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="File" id="bib-Uj-vzu">
|
||||
<items>
|
||||
<menuItem title="New Game" keyEquivalent="n" id="Was-JA-tGl">
|
||||
<connections>
|
||||
<action selector="NewGame:" target="Voe-Tx-rLC" id="wFx-tD-VhG"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="wpr-3q-Mcd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<window title="Tic-Tac-Toe" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<rect key="contentRect" x="335" y="390" width="182" height="337"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="900"/>
|
||||
<view key="contentView" id="EiT-Mj-1SZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="182" height="337"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YyX-02-yoo">
|
||||
<rect key="frame" x="18" y="149" width="146" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Hello!" id="kDN-tP-KI6">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<action selector="Text:" target="Voe-Tx-rLC" id="IvS-Y9-7fO"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<matrix verticalHuggingPriority="750" fixedFrame="YES" mode="highlight" allowsEmptySelection="NO" autosizesCells="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mAE-IZ-FuB">
|
||||
<rect key="frame" x="20" y="174" width="144" height="144"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="cellSize" width="48" height="48"/>
|
||||
<buttonCell key="prototype" type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="did-IZ-byd">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<cells>
|
||||
<column>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="HfB-y0-tE5">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="EKJ-zh-clS">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Fe1-Kh-rT6">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
</column>
|
||||
<column>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Xb8-QH-2x1">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="6H1-EM-G0P">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="HOv-bu-0Hl">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
</column>
|
||||
<column>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ttM-wu-qKy">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="dKZ-n5-hr0">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
<buttonCell type="square" bezelStyle="shadowlessSquare" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="4gq-G3-jDN">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system" size="25"/>
|
||||
</buttonCell>
|
||||
</column>
|
||||
</cells>
|
||||
<connections>
|
||||
<action selector="ClickMatrix:" target="Voe-Tx-rLC" id="J1f-Yj-bQ1"/>
|
||||
</connections>
|
||||
</matrix>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bIJ-gQ-UVt">
|
||||
<rect key="frame" x="20" y="122" width="74" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="You play:" id="mDp-ES-xFN">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<matrix verticalHuggingPriority="750" fixedFrame="YES" mode="highlight" allowsEmptySelection="NO" autosizesCells="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ouk-dN-F1c">
|
||||
<rect key="frame" x="19" y="21" width="144" height="85"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="cellSize" width="72" height="17"/>
|
||||
<textFieldCell key="prototype" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="Ylh-Hw-lPT">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<cells>
|
||||
<column>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Wins:" id="iH5-Oh-hWe">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Loses:" id="4VH-Sx-NFy">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Draws:" id="kUx-qK-aae">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Win rate: " id="Mc0-LH-C6K">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Lose rate:" id="DJH-A4-EXI">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</column>
|
||||
<column>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="0" id="Iha-N9-vxh">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="0" id="dQq-sD-TTJ">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="0" id="36D-ga-V34">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="0%" id="3PM-5R-Z2N">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<textFieldCell scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="0%" id="KNl-oE-eGY">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</column>
|
||||
</cells>
|
||||
</matrix>
|
||||
<comboBox verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="AM8-Hm-CgG">
|
||||
<rect key="frame" x="94" y="115" width="73" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="96W-4a-8Yh">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<objectValues>
|
||||
<string>X</string>
|
||||
<string>O</string>
|
||||
<string>Dual</string>
|
||||
</objectValues>
|
||||
</comboBoxCell>
|
||||
<connections>
|
||||
<action selector="FirstMoveChange:" target="Voe-Tx-rLC" id="l1L-eJ-sQn"/>
|
||||
</connections>
|
||||
</comboBox>
|
||||
</subviews>
|
||||
</view>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// RIAppDelegate.h
|
||||
// Tic-Tac-Toe
|
||||
//
|
||||
// Created by RUSlan on 23.03.14.
|
||||
// Copyright (c) 2014 RUSlan. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface RIAppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
@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
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>RUSlan.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2014 RUSlan. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// Prefix header
|
||||
//
|
||||
// The contents of this file are implicitly included at the beginning of every source file.
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
@@ -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}
|
||||
@@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// main.m
|
||||
// Tic-Tac-Toe
|
||||
//
|
||||
// Created by RUSlan on 23.03.14.
|
||||
// Copyright (c) 2014 RUSlan. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
Reference in New Issue
Block a user