Commit 11e01ed6 by Julio Hermosa

Se agrega la tarea2 correspondiente al poker versión swift.

parent 7a378e5c
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
BBE636EE244519F2000E01F0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE636ED244519F2000E01F0 /* AppDelegate.swift */; };
BBE636F0244519F2000E01F0 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE636EF244519F2000E01F0 /* SceneDelegate.swift */; };
BBE636F2244519F2000E01F0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE636F1244519F2000E01F0 /* ViewController.swift */; };
BBE636F5244519F2000E01F0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BBE636F3244519F2000E01F0 /* Main.storyboard */; };
BBE636F7244519F8000E01F0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BBE636F6244519F8000E01F0 /* Assets.xcassets */; };
BBE636FA244519F8000E01F0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BBE636F8244519F8000E01F0 /* LaunchScreen.storyboard */; };
BBE6370224451A41000E01F0 /* Carta.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE6370124451A41000E01F0 /* Carta.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
BBE636EA244519F2000E01F0 /* poker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = poker.app; sourceTree = BUILT_PRODUCTS_DIR; };
BBE636ED244519F2000E01F0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
BBE636EF244519F2000E01F0 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
BBE636F1244519F2000E01F0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
BBE636F4244519F2000E01F0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
BBE636F6244519F8000E01F0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
BBE636F9244519F8000E01F0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
BBE636FB244519F8000E01F0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BBE6370124451A41000E01F0 /* Carta.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Carta.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
BBE636E7244519F2000E01F0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
BBE636E1244519F2000E01F0 = {
isa = PBXGroup;
children = (
BBE636EC244519F2000E01F0 /* poker */,
BBE636EB244519F2000E01F0 /* Products */,
);
sourceTree = "<group>";
};
BBE636EB244519F2000E01F0 /* Products */ = {
isa = PBXGroup;
children = (
BBE636EA244519F2000E01F0 /* poker.app */,
);
name = Products;
sourceTree = "<group>";
};
BBE636EC244519F2000E01F0 /* poker */ = {
isa = PBXGroup;
children = (
BBE636ED244519F2000E01F0 /* AppDelegate.swift */,
BBE636EF244519F2000E01F0 /* SceneDelegate.swift */,
BBE636F1244519F2000E01F0 /* ViewController.swift */,
BBE636F3244519F2000E01F0 /* Main.storyboard */,
BBE636F6244519F8000E01F0 /* Assets.xcassets */,
BBE636F8244519F8000E01F0 /* LaunchScreen.storyboard */,
BBE636FB244519F8000E01F0 /* Info.plist */,
BBE6370124451A41000E01F0 /* Carta.swift */,
);
path = poker;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
BBE636E9244519F2000E01F0 /* poker */ = {
isa = PBXNativeTarget;
buildConfigurationList = BBE636FE244519F8000E01F0 /* Build configuration list for PBXNativeTarget "poker" */;
buildPhases = (
BBE636E6244519F2000E01F0 /* Sources */,
BBE636E7244519F2000E01F0 /* Frameworks */,
BBE636E8244519F2000E01F0 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = poker;
productName = poker;
productReference = BBE636EA244519F2000E01F0 /* poker.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
BBE636E2244519F2000E01F0 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1110;
LastUpgradeCheck = 1110;
ORGANIZATIONNAME = "Mobile Roshka";
TargetAttributes = {
BBE636E9244519F2000E01F0 = {
CreatedOnToolsVersion = 11.1;
};
};
};
buildConfigurationList = BBE636E5244519F2000E01F0 /* Build configuration list for PBXProject "poker" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = BBE636E1244519F2000E01F0;
productRefGroup = BBE636EB244519F2000E01F0 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
BBE636E9244519F2000E01F0 /* poker */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
BBE636E8244519F2000E01F0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BBE636FA244519F8000E01F0 /* LaunchScreen.storyboard in Resources */,
BBE636F7244519F8000E01F0 /* Assets.xcassets in Resources */,
BBE636F5244519F2000E01F0 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
BBE636E6244519F2000E01F0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BBE636F2244519F2000E01F0 /* ViewController.swift in Sources */,
BBE6370224451A41000E01F0 /* Carta.swift in Sources */,
BBE636EE244519F2000E01F0 /* AppDelegate.swift in Sources */,
BBE636F0244519F2000E01F0 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
BBE636F3244519F2000E01F0 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
BBE636F4244519F2000E01F0 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
BBE636F8244519F8000E01F0 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
BBE636F9244519F8000E01F0 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
BBE636FC244519F8000E01F0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
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;
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
BBE636FD244519F8000E01F0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = 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;
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
BBE636FF244519F8000E01F0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = poker/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = roshka.poker;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
BBE63700244519F8000E01F0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = poker/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = roshka.poker;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
BBE636E5244519F2000E01F0 /* Build configuration list for PBXProject "poker" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BBE636FC244519F8000E01F0 /* Debug */,
BBE636FD244519F8000E01F0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BBE636FE244519F8000E01F0 /* Build configuration list for PBXNativeTarget "poker" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BBE636FF244519F8000E01F0 /* Debug */,
BBE63700244519F8000E01F0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = BBE636E2244519F2000E01F0 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:poker.xcodeproj">
</FileRef>
</Workspace>
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "AD75538F-44D9-4077-A86B-D0C9F689EB7A"
type = "1"
version = "2.0">
</Bucket>
<?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>poker.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
//
// AppDelegate.swift
// poker
//
// Created by Mobile Roshka on 4/13/20.
// Copyright © 2020 Mobile Roshka. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "poker-C.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "poker-D.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "poker-E.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "poker-T.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "poker-logo.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="poker" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Póker" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7qK-tZ-pZY">
<rect key="frame" x="336" y="30" width="96.5" height="48"/>
<fontDescription key="fontDescription" type="system" pointSize="40"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yDe-2w-b0i">
<rect key="frame" x="10" y="158" width="748" height="25"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="SMB-7u-Hkb"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="22"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IRK-zS-xeX">
<rect key="frame" x="359" y="441" width="50" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="Jugar"/>
<connections>
<action selector="jugarAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="v16-pd-LNN"/>
</connections>
</button>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="49" translatesAutoresizingMaskIntoConstraints="NO" id="Ou2-8o-ek7">
<rect key="frame" x="246.5" y="229" width="275" height="89"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vkv-vk-1hC">
<rect key="frame" x="0.0" y="0.0" width="59" height="89"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="foD-Bh-5PJ">
<rect key="frame" x="0.0" y="0.0" width="59" height="89"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Carta1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wZD-mq-pB7">
<rect key="frame" x="0.0" y="0.0" width="59" height="39"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6Zc-Lc-MZl">
<rect key="frame" x="0.0" y="39" width="59" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="IMr-kT-3qA"/>
</constraints>
</imageView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" cocoaTouchSystemColor="darkTextColor"/>
<constraints>
<constraint firstItem="foD-Bh-5PJ" firstAttribute="leading" secondItem="Vkv-vk-1hC" secondAttribute="leading" id="JfD-ye-A7W"/>
<constraint firstAttribute="bottom" secondItem="foD-Bh-5PJ" secondAttribute="bottom" id="NDs-D2-KKQ"/>
<constraint firstItem="foD-Bh-5PJ" firstAttribute="top" secondItem="Vkv-vk-1hC" secondAttribute="top" id="eJF-vU-Ged"/>
<constraint firstAttribute="trailing" secondItem="foD-Bh-5PJ" secondAttribute="trailing" id="f1j-IT-QkB"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kJ6-RS-iMI">
<rect key="frame" x="108" y="0.0" width="59" height="89"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="m7c-vW-wz7">
<rect key="frame" x="0.0" y="0.0" width="59" height="89"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Carta2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="co2-G2-mvw">
<rect key="frame" x="0.0" y="0.0" width="59" height="39"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="hkh-8y-SGC">
<rect key="frame" x="0.0" y="39" width="59" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="RDs-Sn-oFI"/>
</constraints>
</imageView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" cocoaTouchSystemColor="darkTextColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="m7c-vW-wz7" secondAttribute="trailing" id="1Op-b4-nyZ"/>
<constraint firstItem="m7c-vW-wz7" firstAttribute="leading" secondItem="kJ6-RS-iMI" secondAttribute="leading" id="db4-KO-Oc3"/>
<constraint firstItem="m7c-vW-wz7" firstAttribute="top" secondItem="kJ6-RS-iMI" secondAttribute="top" id="jcj-mj-fQL"/>
<constraint firstAttribute="bottom" secondItem="m7c-vW-wz7" secondAttribute="bottom" id="woz-8O-7tU"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OPs-B3-1Ef">
<rect key="frame" x="216" y="0.0" width="59" height="89"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Ctf-ty-Hgs">
<rect key="frame" x="0.0" y="0.0" width="59" height="89"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Carta3" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nET-I0-wui">
<rect key="frame" x="0.0" y="0.0" width="59" height="39"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="AMf-Da-lPQ">
<rect key="frame" x="0.0" y="39" width="59" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="xyh-Ub-SuE"/>
</constraints>
</imageView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" cocoaTouchSystemColor="darkTextColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="Ctf-ty-Hgs" secondAttribute="trailing" id="BNc-ck-skV"/>
<constraint firstAttribute="bottom" secondItem="Ctf-ty-Hgs" secondAttribute="bottom" id="ZTf-aL-dLr"/>
<constraint firstItem="Ctf-ty-Hgs" firstAttribute="leading" secondItem="OPs-B3-1Ef" secondAttribute="leading" id="aG6-Mg-Gb9"/>
<constraint firstItem="Ctf-ty-Hgs" firstAttribute="top" secondItem="OPs-B3-1Ef" secondAttribute="top" id="nti-gC-JxO"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="kJ6-RS-iMI" firstAttribute="centerX" secondItem="Ou2-8o-ek7" secondAttribute="centerX" id="60L-7O-XmY"/>
<constraint firstItem="kJ6-RS-iMI" firstAttribute="leading" secondItem="Ou2-8o-ek7" secondAttribute="leading" constant="108" id="hG0-6G-BpW"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="49" translatesAutoresizingMaskIntoConstraints="NO" id="PeU-dx-cSX">
<rect key="frame" x="300.5" y="342" width="167" height="89"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nSa-K5-FZr">
<rect key="frame" x="0.0" y="0.0" width="59" height="89"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="POb-I3-v1g">
<rect key="frame" x="0.0" y="0.0" width="59" height="89"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Carta4" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uhk-kA-oHv">
<rect key="frame" x="0.0" y="0.0" width="59" height="39"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4cB-Yi-Rqp">
<rect key="frame" x="0.0" y="39" width="59" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="7qQ-YJ-8lt"/>
</constraints>
</imageView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" cocoaTouchSystemColor="darkTextColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="POb-I3-v1g" secondAttribute="bottom" id="DKR-D8-u1M"/>
<constraint firstAttribute="trailing" secondItem="POb-I3-v1g" secondAttribute="trailing" id="YcG-gN-Iq4"/>
<constraint firstItem="POb-I3-v1g" firstAttribute="top" secondItem="nSa-K5-FZr" secondAttribute="top" id="aod-ft-uQ8"/>
<constraint firstItem="POb-I3-v1g" firstAttribute="leading" secondItem="nSa-K5-FZr" secondAttribute="leading" id="tgN-4u-WVK"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pJN-TX-u7x">
<rect key="frame" x="108" y="0.0" width="59" height="89"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="ktJ-ct-jmf">
<rect key="frame" x="0.0" y="0.0" width="59" height="89"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Carta5" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0hO-2H-sNS">
<rect key="frame" x="0.0" y="0.0" width="59" height="39"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="SsM-4A-1du">
<rect key="frame" x="0.0" y="39" width="59" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="d5C-gb-Qf6"/>
</constraints>
</imageView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" cocoaTouchSystemColor="darkTextColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="ktJ-ct-jmf" secondAttribute="trailing" id="PK0-b4-Nsy"/>
<constraint firstItem="ktJ-ct-jmf" firstAttribute="leading" secondItem="pJN-TX-u7x" secondAttribute="leading" id="SuF-vW-hh0"/>
<constraint firstItem="ktJ-ct-jmf" firstAttribute="top" secondItem="pJN-TX-u7x" secondAttribute="top" id="fwz-Hs-d2N"/>
<constraint firstAttribute="bottom" secondItem="ktJ-ct-jmf" secondAttribute="bottom" id="x4v-Tn-egu"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="pJN-TX-u7x" firstAttribute="leading" secondItem="PeU-dx-cSX" secondAttribute="leading" constant="108" id="fo8-T7-DpP"/>
<constraint firstAttribute="height" constant="89" id="kgk-hx-0zp"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="PeU-dx-cSX" firstAttribute="height" secondItem="Ou2-8o-ek7" secondAttribute="height" id="1bh-Cb-fxu"/>
<constraint firstItem="yDe-2w-b0i" firstAttribute="top" secondItem="7qK-tZ-pZY" secondAttribute="bottom" constant="80" id="2Ve-gJ-Zdf"/>
<constraint firstItem="7qK-tZ-pZY" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="30" id="3G6-IF-sqT"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="yDe-2w-b0i" secondAttribute="trailing" constant="10" id="9jO-44-FVE"/>
<constraint firstItem="IRK-zS-xeX" firstAttribute="top" secondItem="PeU-dx-cSX" secondAttribute="bottom" constant="10" id="APb-tF-GQe"/>
<constraint firstItem="yDe-2w-b0i" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="10" id="Bhc-NG-hIk"/>
<constraint firstItem="PeU-dx-cSX" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="N1k-Qw-I4H"/>
<constraint firstItem="PeU-dx-cSX" firstAttribute="top" secondItem="Ou2-8o-ek7" secondAttribute="bottom" constant="24" id="dyZ-7b-HYP"/>
<constraint firstItem="Ou2-8o-ek7" firstAttribute="top" secondItem="yDe-2w-b0i" secondAttribute="bottom" constant="46" id="hxs-tN-4VS"/>
<constraint firstItem="IRK-zS-xeX" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="iVj-y0-HEC"/>
<constraint firstItem="7qK-tZ-pZY" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="kGX-cd-HyQ"/>
<constraint firstItem="yDe-2w-b0i" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="khX-9w-MHA"/>
<constraint firstItem="Ou2-8o-ek7" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="w3j-8l-uEg"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="imagenCarta1" destination="6Zc-Lc-MZl" id="fc8-GN-wOW"/>
<outlet property="imagenCarta2" destination="hkh-8y-SGC" id="ffl-XY-jC1"/>
<outlet property="imagenCarta3" destination="AMf-Da-lPQ" id="8iM-0g-Vzh"/>
<outlet property="imagenCarta4" destination="4cB-Yi-Rqp" id="IJo-fV-q8G"/>
<outlet property="imagenCarta5" destination="SsM-4A-1du" id="c07-ZH-y9K"/>
<outlet property="jugarBtn" destination="IRK-zS-xeX" id="Eo9-0q-9rq"/>
<outlet property="resultadoObtenido" destination="yDe-2w-b0i" id="Wvs-es-KYX"/>
<outlet property="valorCarta1" destination="wZD-mq-pB7" id="u1i-Yc-40c"/>
<outlet property="valorCarta2" destination="co2-G2-mvw" id="Mrg-Wb-PNZ"/>
<outlet property="valorCarta3" destination="nET-I0-wui" id="HJb-Jh-351"/>
<outlet property="valorCarta4" destination="uhk-kA-oHv" id="boV-um-Q4Z"/>
<outlet property="valorCarta5" destination="0hO-2H-sNS" id="RnN-1k-AdP"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-41" y="-571"/>
</scene>
</scenes>
</document>
//
// Carta.swift
// poker
//
// Created by Mobile Roshka on 4/13/20.
// Copyright © 2020 Mobile Roshka. All rights reserved.
//
import Foundation
struct Carta{
var valor = Int()
//var nombre = String()
var palo = Palo.self
//var palo = String()
enum Palo: Int{
case E = 1
case T = 2
case C = 3
case D = 4
}
}
class Baraja{
// var enMesa = [String]()
var valor = [Int]()
var valoresOrdenados = [Int]()
var palo = [String]()
var nombreCarta = [String]()
var nombreJugada = "Carta alta"
private let escalera: [Int] = [1, 10, 11, 12, 13]
//función para extraer 5 cartas y guardar la información en arrays con los valores, el palo y el nombre de la carta en caso de ser A, J, Q y K
func extraerCartas()/*->[String]*/{
let carta = Carta.init()
//recorremos un array de 5 elementos (cada una de las cartas extraídas)
for index in 0...4{
//se elige al azar el palo segun el enum de palo
var paloCarta = carta.palo.init(rawValue: .random(in: 1...4))
//se guarda en el array los valores de la carta y el palo
valor.append(Int.random(in: 1...13))
palo.append("\(paloCarta!)")
//se recorre por los elementos anteriores para determinar si se repitió la carta y si es así escojemos otra
for i in 0..<index{
if valor[index] == valor[i] && palo[index] == palo[i]{
valor.removeLast()
palo.removeLast()
valor.append(Int.random(in: 1...13))
paloCarta = carta.palo.init(rawValue: Int.random(in: 1...4))
palo.append("\(paloCarta!)")
}
}
// se carga en el array auxiliar, que luego se ordenará
valoresOrdenados.append(valor[index])
//se carga en el array el nombre de la carta, 1: A, 11:J, 12:Q y 13:K
switch valor[index] {
case 1:
nombreCarta.append("A"/*+"\(paloCarta!)"*/)
case 11:
nombreCarta.append("J"/*+"\(paloCarta!)"*/)
case 12:
nombreCarta.append("Q"/*+"\(paloCarta!)"*/)
case 13:
nombreCarta.append("K"/*+"\(paloCarta!)"*/)
default:
nombreCarta.append("\(valor[index])"/*+"\(paloCarta!)"*/)
}
}
valoresOrdenados.sort()
return //nombreCarta
}
//devuelve un string con el nombre de la jugada segun la combinación de cartas
func jugadas()->String{
var contSecuencia = 1
var contPalosIguales = 1
var diccionarioCantidad: [Int: Int] = [1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0, 12: 0, 13: 0]
diccionarioCantidad[valoresOrdenados[0]]! += 1
for index in 1...4{
if valoresOrdenados[index] == valoresOrdenados[index-1]+1{
contSecuencia += 1
}
if palo[index] == palo[index-1]{
contPalosIguales += 1
}
if diccionarioCantidad[valoresOrdenados[index]] == 0{
diccionarioCantidad[valoresOrdenados[index]]! += 1
}
if valoresOrdenados[index] == valoresOrdenados[index - 1]{
diccionarioCantidad[valoresOrdenados[index]]! += 1
}
}
if contPalosIguales == 5{
nombreJugada = "Color"
}
if contSecuencia == 5{
nombreJugada = "Escalera"
}
if valoresOrdenados == escalera{
nombreJugada = "Escalera"
}
if nombreJugada == "Escalera" && contPalosIguales == 5 {
nombreJugada = "Escalera Color"
}
let poker = diccionarioCantidad.filter{ $0.value == 4}
let trio = diccionarioCantidad.filter{ $0.value == 3}
let par = diccionarioCantidad.filter{ $0.value == 2}
if par.count == 1{
nombreJugada = "Par"
}
if par.count == 2{
nombreJugada = "Par doble"
}
if trio.count == 1{
nombreJugada = "Trio"
}
if par.count == 1 && trio.count == 1{
nombreJugada = "Full"
}
if poker.count == 1 {
nombreJugada = "Poker"
}
return nombreJugada
}
//eliminamos todas las modificaciones para empezar de nuevo el juego
func barajarCartas(){
valor.removeAll()
palo.removeAll()
valoresOrdenados.removeAll()
nombreCarta.removeAll()
nombreJugada = "Carta alta"
}
}
<?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>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// SceneDelegate.swift
// poker
//
// Created by Mobile Roshka on 4/13/20.
// Copyright © 2020 Mobile Roshka. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
//
// ViewController.swift
// poker
//
// Created by Julio Hermosa on 4/13/20.
// Copyright © 2020 Mobile Roshka. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
//var carta:Carta = Carta.init()
var baraja:Baraja = Baraja()
@IBOutlet weak var resultadoObtenido: UILabel!
@IBOutlet weak var valorCarta1: UILabel!
@IBOutlet weak var valorCarta2: UILabel!
@IBOutlet weak var valorCarta3: UILabel!
@IBOutlet weak var valorCarta4: UILabel!
@IBOutlet weak var valorCarta5: UILabel!
@IBOutlet weak var imagenCarta1: UIImageView!
@IBOutlet weak var imagenCarta2: UIImageView!
@IBOutlet weak var imagenCarta3: UIImageView!
@IBOutlet weak var imagenCarta4: UIImageView!
@IBOutlet weak var imagenCarta5: UIImageView!
@IBOutlet weak var jugarBtn: UIButton!
@IBAction func jugarAction(_ sender: Any) {
jugar()
}
//llamamos a las funciones relativas al juego de la clase baraja (extraer cartas, obtener la jugada y volver a barajar las cartas)
func jugar(){
baraja.extraerCartas()
resultadoObtenido.text = baraja.jugadas()
//cargamos los valores del array en los labels de las cartas
valorCarta1.text = baraja.nombreCarta[0]
valorCarta2.text = baraja.nombreCarta[1]
valorCarta3.text = baraja.nombreCarta[2]
valorCarta4.text = baraja.nombreCarta[3]
valorCarta5.text = baraja.nombreCarta[4]
//segun el nombre de la imagen mostramos su palo
imagenCarta1.image = UIImage(named: "poker-\(baraja.palo[0])")
imagenCarta2.image = UIImage(named: "poker-\(baraja.palo[1])")
imagenCarta3.image = UIImage(named: "poker-\(baraja.palo[2])")
imagenCarta4.image = UIImage(named: "poker-\(baraja.palo[3])")
imagenCarta5.image = UIImage(named: "poker-\(baraja.palo[4])")
baraja.barajarCartas()
}
override func viewDidLoad() {
super.viewDidLoad()
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment