diff --git "a/21451097\345\274\240\344\270\200\346\234\252/.DS_Store" "b/21451097\345\274\240\344\270\200\346\234\252/.DS_Store" index 5c4152cc..027f1f9c 100644 Binary files "a/21451097\345\274\240\344\270\200\346\234\252/.DS_Store" and "b/21451097\345\274\240\344\270\200\346\234\252/.DS_Store" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.pbxproj" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.pbxproj" new file mode 100755 index 00000000..6d9df443 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.pbxproj" @@ -0,0 +1,408 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 18EE3F95191E012700B6E613 /* Cardplayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 18EE3F94191E012700B6E613 /* Cardplayer.m */; }; + 3F07D9431905398A0056BD1F /* Card.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F07D9421905398A0056BD1F /* Card.m */; }; + 3F07D94719053DC60056BD1F /* PlayingCard.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F07D94619053DC60056BD1F /* PlayingCard.m */; }; + 3F07D94A1905438F0056BD1F /* Deck.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F07D9491905438F0056BD1F /* Deck.m */; }; + 3F07D94D190546B30056BD1F /* PlayingCardDeck.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F07D94C190546B30056BD1F /* PlayingCardDeck.m */; }; + 3F224C43191A0CB1009AFC32 /* secondgameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F224C42191A0CB1009AFC32 /* secondgameViewController.m */; }; + 3F224C49191A1536009AFC32 /* historyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F224C48191A1536009AFC32 /* historyViewController.m */; }; + 3F458DDD18FE1B0E0096C0D2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F458DDC18FE1B0E0096C0D2 /* Foundation.framework */; }; + 3F458DDF18FE1B0E0096C0D2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F458DDE18FE1B0E0096C0D2 /* CoreGraphics.framework */; }; + 3F458DE118FE1B0E0096C0D2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F458DE018FE1B0E0096C0D2 /* UIKit.framework */; }; + 3F458DE718FE1B0E0096C0D2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3F458DE518FE1B0E0096C0D2 /* InfoPlist.strings */; }; + 3F458DE918FE1B0E0096C0D2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F458DE818FE1B0E0096C0D2 /* main.m */; }; + 3F458DED18FE1B0E0096C0D2 /* cardgameAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F458DEC18FE1B0E0096C0D2 /* cardgameAppDelegate.m */; }; + 3F458DF018FE1B0E0096C0D2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3F458DEE18FE1B0E0096C0D2 /* Main.storyboard */; }; + 3F458DF318FE1B0E0096C0D2 /* cardgameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F458DF218FE1B0E0096C0D2 /* cardgameViewController.m */; }; + 3F458DF518FE1B0E0096C0D2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F458DF418FE1B0E0096C0D2 /* Images.xcassets */; }; + 3FF2CA0F190755FE00585475 /* CardMatchingGame.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FF2CA0E190755FE00585475 /* CardMatchingGame.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 18EE3F93191E012700B6E613 /* Cardplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cardplayer.h; sourceTree = ""; }; + 18EE3F94191E012700B6E613 /* Cardplayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cardplayer.m; sourceTree = ""; }; + 3F07D9411905398A0056BD1F /* Card.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Card.h; sourceTree = ""; }; + 3F07D9421905398A0056BD1F /* Card.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Card.m; sourceTree = ""; }; + 3F07D94519053DC60056BD1F /* PlayingCard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayingCard.h; sourceTree = ""; }; + 3F07D94619053DC60056BD1F /* PlayingCard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlayingCard.m; sourceTree = ""; }; + 3F07D9481905438F0056BD1F /* Deck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Deck.h; sourceTree = ""; }; + 3F07D9491905438F0056BD1F /* Deck.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Deck.m; sourceTree = ""; }; + 3F07D94B190546B30056BD1F /* PlayingCardDeck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayingCardDeck.h; sourceTree = ""; }; + 3F07D94C190546B30056BD1F /* PlayingCardDeck.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlayingCardDeck.m; sourceTree = ""; }; + 3F224C41191A0CB1009AFC32 /* secondgameViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = secondgameViewController.h; sourceTree = ""; }; + 3F224C42191A0CB1009AFC32 /* secondgameViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = secondgameViewController.m; sourceTree = ""; }; + 3F224C47191A1536009AFC32 /* historyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = historyViewController.h; sourceTree = ""; }; + 3F224C48191A1536009AFC32 /* historyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = historyViewController.m; sourceTree = ""; }; + 3F458DD918FE1B0E0096C0D2 /* Machismo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Machismo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F458DDC18FE1B0E0096C0D2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 3F458DDE18FE1B0E0096C0D2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 3F458DE018FE1B0E0096C0D2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 3F458DE418FE1B0E0096C0D2 /* Machismo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Machismo-Info.plist"; sourceTree = ""; }; + 3F458DE618FE1B0E0096C0D2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 3F458DE818FE1B0E0096C0D2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 3F458DEB18FE1B0E0096C0D2 /* cardgameAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cardgameAppDelegate.h; sourceTree = ""; }; + 3F458DEC18FE1B0E0096C0D2 /* cardgameAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cardgameAppDelegate.m; sourceTree = ""; }; + 3F458DEF18FE1B0E0096C0D2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 3F458DF118FE1B0E0096C0D2 /* cardgameViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cardgameViewController.h; sourceTree = ""; }; + 3F458DF218FE1B0E0096C0D2 /* cardgameViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cardgameViewController.m; sourceTree = ""; }; + 3F458DF418FE1B0E0096C0D2 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 3F458DFB18FE1B0E0096C0D2 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 3F458E0318FE1B0E0096C0D2 /* cardgameTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "cardgameTests-Info.plist"; sourceTree = ""; }; + 3F458E0518FE1B0E0096C0D2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 3F458E0718FE1B0E0096C0D2 /* cardgameTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cardgameTests.m; sourceTree = ""; }; + 3FF2CA0D190755FE00585475 /* CardMatchingGame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardMatchingGame.h; sourceTree = ""; }; + 3FF2CA0E190755FE00585475 /* CardMatchingGame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CardMatchingGame.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3F458DD618FE1B0E0096C0D2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F458DDF18FE1B0E0096C0D2 /* CoreGraphics.framework in Frameworks */, + 3F458DE118FE1B0E0096C0D2 /* UIKit.framework in Frameworks */, + 3F458DDD18FE1B0E0096C0D2 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3F07D944190539D00056BD1F /* Model */ = { + isa = PBXGroup; + children = ( + 3FF2CA0D190755FE00585475 /* CardMatchingGame.h */, + 3FF2CA0E190755FE00585475 /* CardMatchingGame.m */, + 3F07D9411905398A0056BD1F /* Card.h */, + 3F07D9421905398A0056BD1F /* Card.m */, + 3F07D94519053DC60056BD1F /* PlayingCard.h */, + 3F07D94619053DC60056BD1F /* PlayingCard.m */, + 3F07D94B190546B30056BD1F /* PlayingCardDeck.h */, + 3F07D94C190546B30056BD1F /* PlayingCardDeck.m */, + 3F07D9481905438F0056BD1F /* Deck.h */, + 3F07D9491905438F0056BD1F /* Deck.m */, + 18EE3F93191E012700B6E613 /* Cardplayer.h */, + 18EE3F94191E012700B6E613 /* Cardplayer.m */, + ); + name = Model; + sourceTree = ""; + }; + 3F458DD018FE1B0E0096C0D2 = { + isa = PBXGroup; + children = ( + 3F458DE218FE1B0E0096C0D2 /* cardgame */, + 3F458E0118FE1B0E0096C0D2 /* cardgameTests */, + 3F458DDB18FE1B0E0096C0D2 /* Frameworks */, + 3F458DDA18FE1B0E0096C0D2 /* Products */, + ); + sourceTree = ""; + }; + 3F458DDA18FE1B0E0096C0D2 /* Products */ = { + isa = PBXGroup; + children = ( + 3F458DD918FE1B0E0096C0D2 /* Machismo.app */, + ); + name = Products; + sourceTree = ""; + }; + 3F458DDB18FE1B0E0096C0D2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 3F458DDC18FE1B0E0096C0D2 /* Foundation.framework */, + 3F458DDE18FE1B0E0096C0D2 /* CoreGraphics.framework */, + 3F458DE018FE1B0E0096C0D2 /* UIKit.framework */, + 3F458DFB18FE1B0E0096C0D2 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 3F458DE218FE1B0E0096C0D2 /* cardgame */ = { + isa = PBXGroup; + children = ( + 3F224C47191A1536009AFC32 /* historyViewController.h */, + 3F224C48191A1536009AFC32 /* historyViewController.m */, + 3F224C41191A0CB1009AFC32 /* secondgameViewController.h */, + 3F224C42191A0CB1009AFC32 /* secondgameViewController.m */, + 3F458DEB18FE1B0E0096C0D2 /* cardgameAppDelegate.h */, + 3F458DEC18FE1B0E0096C0D2 /* cardgameAppDelegate.m */, + 3F458DEE18FE1B0E0096C0D2 /* Main.storyboard */, + 3F458DF118FE1B0E0096C0D2 /* cardgameViewController.h */, + 3F458DF218FE1B0E0096C0D2 /* cardgameViewController.m */, + 3F07D944190539D00056BD1F /* Model */, + 3F458DF418FE1B0E0096C0D2 /* Images.xcassets */, + 3F458DE318FE1B0E0096C0D2 /* Supporting Files */, + ); + path = cardgame; + sourceTree = ""; + }; + 3F458DE318FE1B0E0096C0D2 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 3F458DE418FE1B0E0096C0D2 /* Machismo-Info.plist */, + 3F458DE518FE1B0E0096C0D2 /* InfoPlist.strings */, + 3F458DE818FE1B0E0096C0D2 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 3F458E0118FE1B0E0096C0D2 /* cardgameTests */ = { + isa = PBXGroup; + children = ( + 3F458E0718FE1B0E0096C0D2 /* cardgameTests.m */, + 3F458E0218FE1B0E0096C0D2 /* Supporting Files */, + ); + path = cardgameTests; + sourceTree = ""; + }; + 3F458E0218FE1B0E0096C0D2 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 3F458E0318FE1B0E0096C0D2 /* cardgameTests-Info.plist */, + 3F458E0418FE1B0E0096C0D2 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3F458DD818FE1B0E0096C0D2 /* Machismo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F458E0B18FE1B0E0096C0D2 /* Build configuration list for PBXNativeTarget "Machismo" */; + buildPhases = ( + 3F458DD518FE1B0E0096C0D2 /* Sources */, + 3F458DD618FE1B0E0096C0D2 /* Frameworks */, + 3F458DD718FE1B0E0096C0D2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Machismo; + productName = cardgame; + productReference = 3F458DD918FE1B0E0096C0D2 /* Machismo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3F458DD118FE1B0E0096C0D2 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = cardgame; + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = "冯超"; + }; + buildConfigurationList = 3F458DD418FE1B0E0096C0D2 /* Build configuration list for PBXProject "Machismo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3F458DD018FE1B0E0096C0D2; + productRefGroup = 3F458DDA18FE1B0E0096C0D2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3F458DD818FE1B0E0096C0D2 /* Machismo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3F458DD718FE1B0E0096C0D2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F458DF518FE1B0E0096C0D2 /* Images.xcassets in Resources */, + 3F458DE718FE1B0E0096C0D2 /* InfoPlist.strings in Resources */, + 3F458DF018FE1B0E0096C0D2 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3F458DD518FE1B0E0096C0D2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F458DED18FE1B0E0096C0D2 /* cardgameAppDelegate.m in Sources */, + 3F224C49191A1536009AFC32 /* historyViewController.m in Sources */, + 3F458DF318FE1B0E0096C0D2 /* cardgameViewController.m in Sources */, + 3F458DE918FE1B0E0096C0D2 /* main.m in Sources */, + 3F07D94719053DC60056BD1F /* PlayingCard.m in Sources */, + 3FF2CA0F190755FE00585475 /* CardMatchingGame.m in Sources */, + 3F224C43191A0CB1009AFC32 /* secondgameViewController.m in Sources */, + 3F07D94D190546B30056BD1F /* PlayingCardDeck.m in Sources */, + 18EE3F95191E012700B6E613 /* Cardplayer.m in Sources */, + 3F07D94A1905438F0056BD1F /* Deck.m in Sources */, + 3F07D9431905398A0056BD1F /* Card.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 3F458DE518FE1B0E0096C0D2 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 3F458DE618FE1B0E0096C0D2 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 3F458DEE18FE1B0E0096C0D2 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3F458DEF18FE1B0E0096C0D2 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 3F458E0418FE1B0E0096C0D2 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 3F458E0518FE1B0E0096C0D2 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 3F458E0918FE1B0E0096C0D2 /* 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; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + 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; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 3F458E0A18FE1B0E0096C0D2 /* 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; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PRECOMPILE_PREFIX_HEADER = 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; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3F458E0C18FE1B0E0096C0D2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = "cardgame/Machismo-Prefix.pch"; + INFOPLIST_FILE = "cardgame/Machismo-Info.plist"; + PRODUCT_NAME = Machismo; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 3F458E0D18FE1B0E0096C0D2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = "cardgame/Machismo-Prefix.pch"; + INFOPLIST_FILE = "cardgame/Machismo-Info.plist"; + PRODUCT_NAME = Machismo; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3F458DD418FE1B0E0096C0D2 /* Build configuration list for PBXProject "Machismo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F458E0918FE1B0E0096C0D2 /* Debug */, + 3F458E0A18FE1B0E0096C0D2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3F458E0B18FE1B0E0096C0D2 /* Build configuration list for PBXNativeTarget "Machismo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F458E0C18FE1B0E0096C0D2 /* Debug */, + 3F458E0D18FE1B0E0096C0D2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3F458DD118FE1B0E0096C0D2 /* Project object */; +} diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/contents.xcworkspacedata" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/contents.xcworkspacedata" new file mode 100755 index 00000000..42424aec --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/contents.xcworkspacedata" @@ -0,0 +1,7 @@ + + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcshareddata/Machismo.xccheckout" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcshareddata/Machismo.xccheckout" new file mode 100644 index 00000000..c48523e7 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcshareddata/Machismo.xccheckout" @@ -0,0 +1,42 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 9370ADEF-7489-4361-9E2D-7FB48592AB80 + IDESourceControlProjectOriginsDictionary + + b04f3ea5-8df2-4f49-979a-db1058f28c9f++8253 + http://112.124.71.113/svn/zjuca/%25E8%25BD%25AF%25E4%25BB%25B6%25E5%25BC%2580%25E5%258F%2591%25E9%2583%25A8/%25E7%259B%25B8%25E5%2585%25B3%25E9%25A1%25B9%25E7%259B%25AE/App + + IDESourceControlProjectRelativeInstallPathDictionary + + b04f3ea5-8df2-4f49-979a-db1058f28c9f++8253 + App/ + + IDESourceControlProjectRepositoryRootDictionary + + b04f3ea5-8df2-4f49-979a-db1058f28c9f++8253 + http://112.124.71.113/svn + + IDESourceControlProjectURL + http://112.124.71.113/svn/zjuca/%25E8%25BD%25AF%25E4%25BB%25B6%25E5%25BC%2580%25E5%258F%2591%25E9%2583%25A8/%25E7%259B%25B8%25E5%2585%25B3%25E9%25A1%25B9%25E7%259B%25AE/App + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + b04f3ea5-8df2-4f49-979a-db1058f28c9f++8253 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.subversion + IDESourceControlWCCIdentifierKey + b04f3ea5-8df2-4f49-979a-db1058f28c9f++8253 + IDESourceControlWCCName + App + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate" new file mode 100755 index 00000000..85a7850d Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/emily.xcuserdatad/UserInterfaceState.xcuserstate" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/emily.xcuserdatad/UserInterfaceState.xcuserstate" new file mode 100644 index 00000000..2d98e3e6 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/emily.xcuserdatad/UserInterfaceState.xcuserstate" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/emily.xcuserdatad/WorkspaceSettings.xcsettings" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/emily.xcuserdatad/WorkspaceSettings.xcsettings" new file mode 100644 index 00000000..659c8766 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/emily.xcuserdatad/WorkspaceSettings.xcsettings" @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/student.xcuserdatad/UserInterfaceState.xcuserstate" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/student.xcuserdatad/UserInterfaceState.xcuserstate" new file mode 100755 index 00000000..5f2509b5 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/project.xcworkspace/xcuserdata/student.xcuserdatad/UserInterfaceState.xcuserstate" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist" new file mode 100755 index 00000000..fe2b4541 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist" @@ -0,0 +1,5 @@ + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/cardgame.xcscheme" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/cardgame.xcscheme" new file mode 100755 index 00000000..d27761ac --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/cardgame.xcscheme" @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist" new file mode 100755 index 00000000..89205a4b --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist" @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + cardgame.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 3F458DD818FE1B0E0096C0D2 + + primary + + + 3F458DF918FE1B0E0096C0D2 + + primary + + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/emily.xcuserdatad/xcschemes/cardgame.xcscheme" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/emily.xcuserdatad/xcschemes/cardgame.xcscheme" new file mode 100644 index 00000000..ecdc3c0f --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/emily.xcuserdatad/xcschemes/cardgame.xcscheme" @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/emily.xcuserdatad/xcschemes/xcschememanagement.plist" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/emily.xcuserdatad/xcschemes/xcschememanagement.plist" new file mode 100644 index 00000000..89205a4b --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/emily.xcuserdatad/xcschemes/xcschememanagement.plist" @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + cardgame.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 3F458DD818FE1B0E0096C0D2 + + primary + + + 3F458DF918FE1B0E0096C0D2 + + primary + + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist" new file mode 100755 index 00000000..fe2b4541 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist" @@ -0,0 +1,5 @@ + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcschemes/cardgame.xcscheme" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcschemes/cardgame.xcscheme" new file mode 100755 index 00000000..d27761ac --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcschemes/cardgame.xcscheme" @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcschemes/xcschememanagement.plist" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcschemes/xcschememanagement.plist" new file mode 100755 index 00000000..89205a4b --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Machismo.xcodeproj/xcuserdata/student.xcuserdatad/xcschemes/xcschememanagement.plist" @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + cardgame.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 3F458DD818FE1B0E0096C0D2 + + primary + + + 3F458DF918FE1B0E0096C0D2 + + primary + + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/Play.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Play.png" new file mode 100755 index 00000000..bf44bf32 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/Play.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Base.lproj/Main.storyboard" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Base.lproj/Main.storyboard" new file mode 100755 index 00000000..bfd14060 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Base.lproj/Main.storyboard" @@ -0,0 +1,724 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Card.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Card.h" new file mode 100755 index 00000000..50d44d47 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Card.h" @@ -0,0 +1,20 @@ +// +// Card.h +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import + +@interface Card : NSObject + +@property (strong,nonatomic) NSString *contents; + +@property (nonatomic,getter = isChosen) BOOL chosen; +@property (nonatomic,getter = isMatched) BOOL matched; + +-(int)match:(NSArray *)otherCards; + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Card.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Card.m" new file mode 100755 index 00000000..640ec7c7 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Card.m" @@ -0,0 +1,25 @@ +// +// Card.m +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "Card.h" + +@implementation Card + +- (int)match:(NSArray *)otherCards +{ + int score = 0; + for (Card *card in otherCards){ + + if ([card.contents isEqualToString:self.contents]) { + score = 1; + } + } + + return score; +} +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/CardMatchingGame.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/CardMatchingGame.h" new file mode 100755 index 00000000..d6cf2179 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/CardMatchingGame.h" @@ -0,0 +1,23 @@ +// +// CardMatchingGame.h +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import +#import "Card.h" +#import "Deck.h" + +@interface CardMatchingGame : NSObject + +//designated initializer +-(instancetype)initWithCardCount:(NSUInteger)count usingDeck:(Deck *)deck; + +-(void)chooseCardAtIndex:(NSUInteger)index; +-(Card *)cardAtIndex:(NSUInteger)index; + +@property(nonatomic,readonly) NSInteger score; + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/CardMatchingGame.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/CardMatchingGame.m" new file mode 100755 index 00000000..9af08cd5 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/CardMatchingGame.m" @@ -0,0 +1,130 @@ +// +// CardMatchingGame.m +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "CardMatchingGame.h" +#import "cardgameViewController.h" + + +@interface CardMatchingGame() +@property(nonatomic,readwrite) NSInteger score; +@property(nonatomic,strong) NSMutableArray *cards; + +@end + +@implementation CardMatchingGame + +-(NSMutableArray *)cards +{ + if (!_cards) { + _cards=[[NSMutableArray alloc] init]; + } + return _cards; +} + +-(instancetype)initWithCardCount:(NSUInteger)count usingDeck:(Deck *)deck +{ + self = [super init]; + if (self) { + for (int i = 0; i < count; i++) { + Card *card = [deck drawRandomCard]; + if (card) { + [self.cards addObject:card]; + } else{ + self = nil; + break; + } + + } + } + return self; +} + +-(Card *)cardAtIndex:(NSUInteger)index +{ + return (index<[self.cards count]) ? self.cards[index] : nil; +} + +static const int MISMATCH_PENALTY = 2; +static const int MATCH_BONUS = 4; +static const int COST_TO_CHOOSE = 1; +static const int MISMATCH_PENALTY3 = 2; +static const int MATCH_BONUS3 = 5; +static const int COST_TO_CHOOSE3 = 1; + + +-(void)chooseCardAtIndex:(NSUInteger)index +{ + Card *card = [self cardAtIndex:index]; + if (!card.isMatched) { + if (card.isChosen) { + card.chosen = NO; + } else{ + Card *firstCard=nil; + Card *secondCard=nil; + switch (flagcard) { + case 0: + for(Card *otherCard in self.cards){ + if (otherCard.isChosen && !otherCard.isMatched) { + int matchScore = [card match:@[otherCard]]; + if (matchScore) { + self.score += matchScore * MATCH_BONUS; + otherCard.matched = YES; + card.matched = YES; + } else{ + self.score -= MISMATCH_PENALTY; + otherCard.chosen = NO; + } + break; + } + } + self.score -= COST_TO_CHOOSE; + card.chosen = YES; + break; + + case 1: + for (Card *otherCard in self.cards) { + if (otherCard.isChosen && !otherCard.isMatched) { + if (!firstCard) { + firstCard = otherCard; + } + if (firstCard != otherCard) { + secondCard = otherCard; + } + if (secondCard) { + int matchScore = [card match:@[firstCard,secondCard]]; + if (matchScore>0) { + firstCard.matched=YES; + secondCard.matched=YES; + card.matched=YES; + self.score+=matchScore * MATCH_BONUS3; + + } + else + { + firstCard.chosen = NO; + secondCard.chosen = NO; + self.score -= matchScore * MISMATCH_PENALTY3; + + } + break; + } + } + + } + self.score -= COST_TO_CHOOSE3; + card.chosen = YES; + break; + break; + default: + break; + } + } + } +} + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Cardplayer.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Cardplayer.h" new file mode 100755 index 00000000..26c9fba7 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Cardplayer.h" @@ -0,0 +1,16 @@ +// +// Cardplayer.h +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import + +@interface Cardplayer : NSObject +@property (strong,nonatomic) NSString *contents; + +-(void)randromcontents; + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Cardplayer.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Cardplayer.m" new file mode 100755 index 00000000..cae6aa37 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Cardplayer.m" @@ -0,0 +1,31 @@ +// +// Cardplayer.m +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "Cardplayer.h" + +@implementation Cardplayer +-(void)randromcontents +{ + + int value = arc4random()%3; + if(value==0) + { + self.contents=@"✌️"; + } + else if (value==1) + { + self.contents=@"👊"; + } + else + { + self.contents=@"👋"; + } +} + + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Deck.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Deck.h" new file mode 100755 index 00000000..622e539b --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Deck.h" @@ -0,0 +1,19 @@ +// +// Deck.h +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "Card.h" +#import + +@interface Deck : NSObject + +- (void)addCard:(Card *)card atTop:(BOOL)atTop; +- (void)addCard:(Card *)card; + +- (Card *)drawRandomCard; + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Deck.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Deck.m" new file mode 100755 index 00000000..2103c438 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Deck.m" @@ -0,0 +1,50 @@ +// +// Deck.m +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "Deck.h" + +@interface Deck() +@property (strong, nonatomic) NSMutableArray *cards; + +@end + +@implementation Deck + +- (NSMutableArray *)cards +{ + if (!_cards) _cards = [[NSMutableArray alloc] init]; + return _cards; +} + +- (void)addCard:(Card *)card atTop:(BOOL)atTop +{ + if (atTop) { + [self.cards insertObject:card atIndex:0]; + } else{ + [self.cards addObject:card]; + } +} + +- (void)addCard:(Card *)card +{ + [self addCard:card atTop:NO]; +} + +- (Card *)drawRandomCard +{ + Card *randomCard = nil; + + if ([self.cards count]) { + unsigned index = arc4random() % [self.cards count]; + randomCard = self.cards[index]; + [self.cards removeObjectAtIndex:index]; + } + return randomCard; +} + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/Contents.json" new file mode 100755 index 00000000..346678d9 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,32 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon-29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "entertain.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon-60@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/entertain.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/entertain.png" new file mode 100644 index 00000000..80ffee5b Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/entertain.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-29@2x.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-29@2x.png" new file mode 100644 index 00000000..b76cd57b Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-29@2x.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-40@2x.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-40@2x.png" new file mode 100644 index 00000000..3208e4d1 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-40@2x.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-60@3x.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-60@3x.png" new file mode 100644 index 00000000..e58ad961 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/AppIcon.appiconset/icon-60@3x.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/LaunchImage.launchimage/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/LaunchImage.launchimage/Contents.json" new file mode 100755 index 00000000..37623d0f --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/LaunchImage.launchimage/Contents.json" @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "retina4", + "filename" : "bg1@2x.png", + "minimum-system-version" : "7.0", + "orientation" : "portrait", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/LaunchImage.launchimage/bg1@2x.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/LaunchImage.launchimage/bg1@2x.png" new file mode 100644 index 00000000..750f0426 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/LaunchImage.launchimage/bg1@2x.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Contents.json" new file mode 100755 index 00000000..e5b63998 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Play.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Play-1.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Play-1.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Play-1.png" new file mode 100755 index 00000000..bf44bf32 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Play-1.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Play.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Play.png" new file mode 100755 index 00000000..bf44bf32 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/Play.imageset/Play.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/Contents.json" new file mode 100755 index 00000000..b59a659c --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "stanford-tree-1.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "stanford-tree.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/stanford-tree-1.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/stanford-tree-1.png" new file mode 100755 index 00000000..30681a54 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/stanford-tree-1.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/stanford-tree.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/stanford-tree.png" new file mode 100755 index 00000000..30681a54 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardback.imageset/stanford-tree.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/Contents.json" new file mode 100755 index 00000000..77a8364b --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "blank card rounded corner.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "blank card hi-res.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/blank card hi-res.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/blank card hi-res.png" new file mode 100755 index 00000000..d5723d8b Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/blank card hi-res.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/blank card rounded corner.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/blank card rounded corner.png" new file mode 100755 index 00000000..569f8bf2 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/cardfront.imageset/blank card rounded corner.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/Contents.json" new file mode 100755 index 00000000..98fe6f33 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "hand.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "hand-1.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/hand-1.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/hand-1.png" new file mode 100755 index 00000000..ce03f642 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/hand-1.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/hand.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/hand.png" new file mode 100755 index 00000000..ce03f642 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/hand.imageset/hand.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/Contents.json" new file mode 100755 index 00000000..1d23a776 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "spades.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "spades-1.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/spades-1.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/spades-1.png" new file mode 100755 index 00000000..278b0813 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/spades-1.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/spades.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/spades.png" new file mode 100755 index 00000000..278b0813 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/spades.imageset/spades.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/Contents.json" new file mode 100755 index 00000000..583740ca --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "剪刀.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "剪刀-1.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/\345\211\252\345\210\200-1.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/\345\211\252\345\210\200-1.png" new file mode 100755 index 00000000..0291f4c6 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/\345\211\252\345\210\200-1.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/\345\211\252\345\210\200.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/\345\211\252\345\210\200.png" new file mode 100755 index 00000000..0291f4c6 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\211\252\345\210\200.imageset/\345\211\252\345\210\200.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/Contents.json" new file mode 100755 index 00000000..44eaf0c7 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "布.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "布-1.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/\345\270\203-1.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/\345\270\203-1.png" new file mode 100755 index 00000000..1d0881c6 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/\345\270\203-1.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/\345\270\203.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/\345\270\203.png" new file mode 100755 index 00000000..1d0881c6 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\345\270\203.imageset/\345\270\203.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/Contents.json" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/Contents.json" new file mode 100644 index 00000000..95603476 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/Contents.json" @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "石头.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "石头-1.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/\347\237\263\345\244\264-1.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/\347\237\263\345\244\264-1.png" new file mode 100644 index 00000000..dbac67ef Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/\347\237\263\345\244\264-1.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/\347\237\263\345\244\264.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/\347\237\263\345\244\264.png" new file mode 100644 index 00000000..dbac67ef Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Images.xcassets/\347\237\263\345\244\264.imageset/\347\237\263\345\244\264.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Machismo-Info.plist" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Machismo-Info.plist" new file mode 100755 index 00000000..1747c491 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Machismo-Info.plist" @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + -011110309.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Machismo-Prefix.pch" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Machismo-Prefix.pch" new file mode 100755 index 00000000..82a2bb45 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/Machismo-Prefix.pch" @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCard.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCard.h" new file mode 100755 index 00000000..a8b6dd7d --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCard.h" @@ -0,0 +1,19 @@ +// +// PlayingCard.h +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "Card.h" + +@interface PlayingCard : Card + +@property (strong, nonatomic) NSString *suit; +@property (nonatomic) NSUInteger rank; + ++ (NSArray *)validSuits; ++ (NSUInteger)maxRank; + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCard.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCard.m" new file mode 100755 index 00000000..6c478158 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCard.m" @@ -0,0 +1,80 @@ +// +// PlayingCard.m +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "PlayingCard.h" + +@implementation PlayingCard + +- (int)match:(NSArray *)otherCards +{ + int score = 0; + if ([otherCards count] == 1){ + PlayingCard *otherCard = [otherCards firstObject]; + if (otherCard.rank == self.rank) { + score = 4; + } else if ([otherCard.suit isEqualToString:self.suit]) + score = 1; + }else if(otherCards.count ==2) + { + PlayingCard *firstCard =otherCards[0]; + PlayingCard *secondCard =otherCards[1]; + if([firstCard.suit isEqualToString:self.suit] && [firstCard.suit isEqualToString:secondCard.suit]) + { + score =1; + }else if(firstCard.rank ==self.rank && firstCard.rank==secondCard.rank) + { + score = 4; + } + } + + + + return score; +} + +-(NSString *)contents +{ + NSArray *rankStrings =[PlayingCard rankstrings]; + return [rankStrings[self.rank] stringByAppendingString:self.suit]; +} + +@synthesize suit=_suit; + ++ (NSArray *)validSuits +{ + return @[@"♥️",@"♦️",@"♠️",@"♣️"]; +} + +- (void)setSuit:(NSString *)suit +{ + if ([[PlayingCard validSuits] containsObject:suit]) { + _suit = suit; + } +} + +- (NSString *)suit +{ + return _suit ? _suit : @"?"; +} + ++ (NSArray *)rankstrings +{ + return @[@"?",@"A",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10", + @"J",@"Q",@"K"];; +} + ++ (NSUInteger)maxRank { return [[self rankstrings] count] - 1;} + +- (void)setRank:(NSUInteger)rank +{ + if (rank <= [PlayingCard maxRank]) { + _rank = rank; + } +} + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCardDeck.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCardDeck.h" new file mode 100755 index 00000000..4a7a4e34 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCardDeck.h" @@ -0,0 +1,13 @@ +// +// PlayingCardDeck.h +// cardgame +// +// Created by emily on 14-10-1. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "Deck.h" + +@interface PlayingCardDeck : Deck + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCardDeck.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCardDeck.m" new file mode 100755 index 00000000..0fce3819 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/PlayingCardDeck.m" @@ -0,0 +1,30 @@ +// +// PlayingCardDeck.m +// cardgame +// +// Created by emily on 14-10-1. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "PlayingCardDeck.h" +#import "PlayingCard.h" + +@implementation PlayingCardDeck + +- (instancetype)init +{ + self = [super init]; + + if(self) { + for (NSString *suit in [ PlayingCard validSuits]) { + for (NSUInteger rank = 1; rank <= [PlayingCard maxRank]; + rank++) { + PlayingCard *card = [[PlayingCard alloc] init]; + card.rank = rank; + card.suit = suit; + [self addCard:card]; } + } + } + return self; +} +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameAppDelegate.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameAppDelegate.h" new file mode 100755 index 00000000..786287a6 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameAppDelegate.h" @@ -0,0 +1,15 @@ +// +// cardgameAppDelegate.h +// cardgame +// +// Created by emily on 14-11-7. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import + +@interface cardgameAppDelegate : UIResponder + +@property (strong, nonatomic)UIWindow *window; + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameAppDelegate.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameAppDelegate.m" new file mode 100755 index 00000000..2a473f16 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameAppDelegate.m" @@ -0,0 +1,47 @@ +// +// cardgameAppDelegate.m +// cardgame +// +// Created by emily on 14-11-7. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "cardgameAppDelegate.h" + + +@implementation cardgameAppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameViewController.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameViewController.h" new file mode 100755 index 00000000..90f5bfa4 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameViewController.h" @@ -0,0 +1,17 @@ +// +// cardgameViewController.h +// cardgame +// +// Created by emily on 14-11-13. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import + +extern int flagcard; + + +@interface cardgameViewController : UIViewController +@end + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameViewController.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameViewController.m" new file mode 100755 index 00000000..5c4d40de --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/cardgameViewController.m" @@ -0,0 +1,146 @@ +// +// cardgameViewController.m +// cardgame +// +// Created by emily on 14-11-13. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "cardgameViewController.h" +#import "Deck.h" +#import "PlayingCardDeck.h" +#import "CardMatchingGame.h" +#import "historyViewController.h" + +int flagcard=0; + + +@interface cardgameViewController () +@property (strong, nonatomic) IBOutlet UISegmentedControl *change; +@property (weak, nonatomic) IBOutlet UILabel *flipsLabel; +@property (nonatomic) int flipCount; +@property (strong, nonatomic) Deck *deck; +@property (strong,nonatomic) CardMatchingGame *game; +@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *cardButtons; +@property (weak, nonatomic) IBOutlet UILabel *scoreLabel; +@property (strong, nonatomic) IBOutlet UIButton *deal; +@property (nonatomic,copy) NSString* oldhistory; +@property (nonatomic,copy) NSString* history; + +@end + +@implementation cardgameViewController +- (IBAction)change:(id)sender { + UISegmentedControl *seg = (UISegmentedControl *)sender; + int index = (int)seg.selectedSegmentIndex; + switch (index) { + + case 0: + flagcard = 0; + self.game=nil; + [self updateUI]; + break; + case 1: + flagcard = 1; + self.game=nil; + [self updateUI]; + break; + default: + break; + } +} +- (IBAction)ddd:(id)sender { + if (_oldhistory==NULL) + { + _history = [NSString stringWithFormat:@"本局最终得分为:%ld\n",(long)_game.score]; + _oldhistory = _history; + } + else + { + _oldhistory = _history; + _history = [NSString stringWithFormat:@"%@\n 本局最终得分为:%ld\n",_oldhistory,(long)_game.score]; + + } + self.game=nil; + [self updateUI]; +} + +- (CardMatchingGame *)game +{ + if (!_game) _game = [[CardMatchingGame alloc] initWithCardCount:[self.cardButtons count] + usingDeck:[self createDeck]]; + return _game; +} + +- (Deck *)deck +{ + if (!_deck) _deck = [self createDeck]; + return _deck; +} + +- (Deck *)createDeck +{ + return [[PlayingCardDeck alloc] init]; +} + +- (void)setFlipCount:(int)flipCount +{ + _flipCount = flipCount; + self.flipsLabel.text = [NSString stringWithFormat:@"Flips: %d",self.flipCount]; +} +- (IBAction)touchCardButton:(UIButton *)sender +{ + unsigned long chosenBUttonIndex = [self.cardButtons indexOfObject:sender]; + [self.game chooseCardAtIndex:chosenBUttonIndex]; + [self updateUI]; + self.flipCount++; +} + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + + if ([segue.destinationViewController isKindOfClass:[historyViewController class]]) + { + historyViewController *vc = (historyViewController *)segue.destinationViewController; + // vc.historyvaluse = [NSString stringWithFormat:@"[%@-----]%@\n",_gamelog.text,_gameresult.text]; + vc.historyvaluse = _history; + } + +} + + +- (void)updateUI +{ + for (UIButton *cardButton in self.cardButtons) { + unsigned long cardButtonIndex = [self.cardButtons indexOfObject:cardButton]; + Card *card = [self.game cardAtIndex:cardButtonIndex]; + [cardButton setTitle:[self titleForCard:card] forState: UIControlStateNormal]; + [cardButton setBackgroundImage:[self backgroundImageForCard:card] forState:UIControlStateNormal]; + cardButton.enabled = !card.isMatched; + self.scoreLabel.text = [NSString stringWithFormat:@"Score: %ld", (long)self.game.score]; + } +} + +- (NSString *)titleForCard:(Card *)card +{ + return card.isChosen ? card.contents : @""; +} + +- (UIImage *)backgroundImageForCard:(Card *)card +{ + return [UIImage imageNamed:card.isChosen ? @"cardfront" :@"cardback" ]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/en.lproj/InfoPlist.strings" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/en.lproj/InfoPlist.strings" new file mode 100755 index 00000000..477b28ff --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/en.lproj/InfoPlist.strings" @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/historyViewController.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/historyViewController.h" new file mode 100755 index 00000000..d753f26f --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/historyViewController.h" @@ -0,0 +1,16 @@ +// +// historyViewController.h +// cardgame +// +// Created by emily on 14-11-7. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import + +@interface historyViewController : UIViewController + +@property (nonatomic,copy)NSString* historyvaluse; +@property (nonatomic,copy)NSString* oldhistoryvaluse; + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/historyViewController.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/historyViewController.m" new file mode 100755 index 00000000..34abbd66 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/historyViewController.m" @@ -0,0 +1,50 @@ +// +// historyViewController.m +// cardgame +// +// Created by emily on 14-11-7. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "historyViewController.h" + +@interface historyViewController () + +@property (weak, nonatomic) IBOutlet UITextView *historyText; +@property (weak, nonatomic) IBOutlet UIBarButtonItem *clearHistory; + +@end + +@implementation historyViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (IBAction)clearRecord:(id)sender +{ + if (_historyText) { + _historyText.text = nil; + } +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. + + _historyText.text = _historyvaluse; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/main.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/main.m" new file mode 100755 index 00000000..a5022d5e --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/main.m" @@ -0,0 +1,18 @@ +// +// main.m +// cardgame +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import + +#import "cardgameAppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([cardgameAppDelegate class])); + } +} diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/secondgameViewController.h" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/secondgameViewController.h" new file mode 100755 index 00000000..e9619ffd --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/secondgameViewController.h" @@ -0,0 +1,12 @@ +// +// secondgameViewController.h +// cardgame +// +// Created by emily on 14-11-7. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import + +@interface secondgameViewController : UIViewController +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/secondgameViewController.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/secondgameViewController.m" new file mode 100755 index 00000000..356f2006 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgame/secondgameViewController.m" @@ -0,0 +1,215 @@ +// +// secondgameViewController.m +// cardgame +// +// Created by emily on 14-11-7. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import "secondgameViewController.h" +#import "Cardplayer.h" +#import "historyViewController.h" + + +@interface secondgameViewController () + +@property (weak, nonatomic) IBOutlet UISegmentedControl *playerchoose; +@property (weak, nonatomic) IBOutlet UILabel *gamelog; +@property (weak, nonatomic) IBOutlet UILabel *gameresult; +@property (weak, nonatomic) IBOutlet UILabel *playerscore; +@property (weak, nonatomic) IBOutlet UILabel *computerscore; +@property (weak, nonatomic) IBOutlet UIButton *palyerchoice; +@property (weak, nonatomic) IBOutlet UIButton *computerchoice; +@property (strong,nonatomic) Cardplayer* player; +@property (strong,nonatomic) Cardplayer* computer; +@property (nonatomic) int playersc; +@property (nonatomic) int computersc; +@property (nonatomic,copy) NSString* oldhistory; +@property (nonatomic,copy) NSString* history; + +@end + +@implementation secondgameViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +static const int CHOOSE_FIRST_SCISSORS = 0; +static const int CHOOSE_SECOND_STONE = 1; +static const int CHOOSE_THIRD_CLOTH = 2; + +- (IBAction)palygame:(id)sender { + + self.computer = [[Cardplayer alloc]init]; + self.player = [[Cardplayer alloc]init]; + + [self.computer randromcontents]; + NSString *computercontents = [self.computer contents]; + int index = (int)_playerchoose.selectedSegmentIndex; + NSString *title = [self.playerchoose titleForSegmentAtIndex:index]; + + switch (index) { + case CHOOSE_FIRST_SCISSORS : + + [self judgeWin:self.player andName:self.computer]; + [self uodateUI:title andName:computercontents]; + break; + case CHOOSE_SECOND_STONE : + [self judgeWin:self.player andName:self.computer]; + [self uodateUI:title andName:computercontents]; + break; + case CHOOSE_THIRD_CLOTH : + [self judgeWin:self.player andName:self.computer]; + [self uodateUI:title andName:computercontents]; + break; + + default: + break; + } + // historyViewController *historyvalus = [[historyViewController alloc] initWithNibName:@"historyViewController" bundle:[NSBundle mainBundle]]; + // historyvalus.historyvaluse = [NSString stringWithFormat:@"[%@----- %@]\n",_gamelog.text,_gameresult.text]; + // [self presentModalViewController:historyvalus animated:YES]; + // [self presentViewController:historyvalus animated:YES completion:nil]; + if (_oldhistory==NULL) + { + _history = [NSString stringWithFormat:@"[%@]-----%@\n",_gamelog.text,_gameresult.text]; + _oldhistory = _history; + } + else + { + _oldhistory = _history; + _history = [NSString stringWithFormat:@"%@\n [%@]-----%@\n",_oldhistory,_gamelog.text,_gameresult.text]; + + } +} + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + + if ([segue.destinationViewController isKindOfClass:[historyViewController class]]) + { + historyViewController *vc = (historyViewController *)segue.destinationViewController; + // vc.historyvaluse = [NSString stringWithFormat:@"[%@-----]%@\n",_gamelog.text,_gameresult.text]; + vc.historyvaluse = _history; + } + +} + +- (void)uodateUI:(NSString*)title andName:(NSString*)computercontents +{ + self.gamelog.text = [NSString stringWithFormat:@"你选择的是%@,电脑选择的是%@",title,computercontents]; + if ([title isEqualToString:@"✌️"]) + { + [self.palyerchoice setImage:[UIImage imageNamed:@"剪刀"] forState:UIControlStateNormal]; + } + else if([title isEqualToString:@"👊"]) + { + [self.palyerchoice setImage:[UIImage imageNamed:@"石头"] forState:UIControlStateNormal]; + } + + else if([title isEqualToString:@"👋"]) + { + [self.palyerchoice setImage:[UIImage imageNamed:@"布"] forState:UIControlStateNormal]; + } + + if([computercontents isEqualToString:@"✌️"]) + { + [self.computerchoice setImage:[UIImage imageNamed:@"剪刀"] forState:UIControlStateNormal]; + } + else if ([computercontents isEqualToString:@"👊"]) + { + [self.computerchoice setImage:[UIImage imageNamed:@"石头"] forState:UIControlStateNormal]; + } + else if ([computercontents isEqualToString:@"👋"]) + { + [self.computerchoice setImage:[UIImage imageNamed:@"布"] forState:UIControlStateNormal]; + } + +} + +-(Cardplayer*)judgeGame:(Cardplayer*)player andName:(Cardplayer*)computer +{ + + + //[self.computer randromcontents]; + NSString *computercontents = [self.computer contents]; + int index = (int)_playerchoose.selectedSegmentIndex; + NSString *title = [self.playerchoose titleForSegmentAtIndex:index]; + if (([title isEqualToString:@"✌️"]&&[computercontents isEqualToString:@"✌️"]) + ||([title isEqualToString:@"👊"]&&[computercontents isEqualToString:@"👊"]) + ||([title isEqualToString:@"👋"]&&[computercontents isEqualToString:@"👋"])) + { + return NULL; + } + else if([title isEqualToString:@"✌️"]&&[computercontents isEqualToString:@"👊"]) + { + return computer; + } + else if([title isEqualToString:@"✌️"]&&[computercontents isEqualToString:@"👋"]) + { + return player; + } + else if([title isEqualToString:@"👊"]&&[computercontents isEqualToString:@"✌️"]) + { + return player; + } + else if([title isEqualToString:@"👊"]&&[computercontents isEqualToString:@"👋"]) + { + return computer; + } + else if([title isEqualToString:@"👋"]&&[computercontents isEqualToString:@"✌️"]) + { + return computer; + } + else + { + return player; + } +} + +-(void)judgeWin:(Cardplayer*)player andName:(Cardplayer*)computer +{ + if([[self judgeGame:player andName:computer] isEqual:player]) + { + self.playersc++; + self.playerscore.text=[NSString stringWithFormat:@"玩家得分:%d",self.playersc]; + self.gameresult.textColor = [UIColor greenColor]; + self.gameresult.text=@"你赢了"; + ; + } + else if([[self judgeGame:player andName:computer] isEqual:computer]) + { + self.computersc++; + self.computerscore.text=[NSString stringWithFormat:@"电脑得分:%d",self.computersc]; + self.gameresult.textColor = [UIColor redColor]; + self.gameresult.text=@"你输了"; + + } + else + { + self.playerscore.text=[NSString stringWithFormat:@"玩家得分:%d",self.playersc]; + self.computerscore.text=[NSString stringWithFormat:@"电脑得分:%d",self.computersc]; + self.gameresult.textColor = [UIColor blueColor]; + self.gameresult.text=@"平局"; + } +} + +@end diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/cardgameTests-Info.plist" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/cardgameTests-Info.plist" new file mode 100755 index 00000000..5d63c531 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/cardgameTests-Info.plist" @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + -011110309.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/cardgameTests.m" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/cardgameTests.m" new file mode 100755 index 00000000..2892d488 --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/cardgameTests.m" @@ -0,0 +1,34 @@ +// +// cardgameTests.m +// cardgameTests +// +// Created by emily on 14-10-2. +// Copyright (c) 2014年 com.emily. All rights reserved. +// + +#import + +@interface cardgameTests : XCTestCase + +@end + +@implementation cardgameTests + +- (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/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/en.lproj/InfoPlist.strings" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/en.lproj/InfoPlist.strings" new file mode 100755 index 00000000..477b28ff --- /dev/null +++ "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/cardgameTests/en.lproj/InfoPlist.strings" @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/hand.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/hand.png" new file mode 100755 index 00000000..ce03f642 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/hand.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/spades-1.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/spades-1.png" new file mode 100755 index 00000000..278b0813 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/spades-1.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/\345\211\252\345\210\200.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/\345\211\252\345\210\200.png" new file mode 100644 index 00000000..e5c87148 Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/\345\211\252\345\210\200.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/\345\270\203.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/\345\270\203.png" new file mode 100644 index 00000000..a37192cb Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/\345\270\203.png" differ diff --git "a/21451097\345\274\240\344\270\200\346\234\252/Machismo/\347\237\263\345\244\264.png" "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/\347\237\263\345\244\264.png" new file mode 100644 index 00000000..dbac67ef Binary files /dev/null and "b/21451097\345\274\240\344\270\200\346\234\252/Machismo/\347\237\263\345\244\264.png" differ