diff --git b/generala/Preguntas - desarrollo.pdf a/generala/Preguntas - desarrollo.pdf new file mode 100644 index 0000000..f2e9893 Binary files /dev/null and a/generala/Preguntas - desarrollo.pdf differ diff --git b/generala/generala.xcodeproj/project.pbxproj a/generala/generala.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5c0aade --- /dev/null +++ a/generala/generala.xcodeproj/project.pbxproj @@ -0,0 +1,345 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + BBE636CC243FB205000E01F0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE636CB243FB205000E01F0 /* AppDelegate.swift */; }; + BBE636CE243FB205000E01F0 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE636CD243FB205000E01F0 /* SceneDelegate.swift */; }; + BBE636D0243FB205000E01F0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE636CF243FB205000E01F0 /* ViewController.swift */; }; + BBE636D3243FB205000E01F0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BBE636D1243FB205000E01F0 /* Main.storyboard */; }; + BBE636D5243FB208000E01F0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BBE636D4243FB208000E01F0 /* Assets.xcassets */; }; + BBE636D8243FB208000E01F0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BBE636D6243FB208000E01F0 /* LaunchScreen.storyboard */; }; + BBE636E0243FB25D000E01F0 /* Dado.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE636DF243FB25D000E01F0 /* Dado.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + BBE636C8243FB205000E01F0 /* generala.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = generala.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BBE636CB243FB205000E01F0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + BBE636CD243FB205000E01F0 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + BBE636CF243FB205000E01F0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + BBE636D2243FB205000E01F0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + BBE636D4243FB208000E01F0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + BBE636D7243FB208000E01F0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + BBE636D9243FB208000E01F0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BBE636DF243FB25D000E01F0 /* Dado.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dado.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + BBE636C5243FB205000E01F0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + BBE636BF243FB204000E01F0 = { + isa = PBXGroup; + children = ( + BBE636CA243FB205000E01F0 /* generala */, + BBE636C9243FB205000E01F0 /* Products */, + ); + sourceTree = ""; + }; + BBE636C9243FB205000E01F0 /* Products */ = { + isa = PBXGroup; + children = ( + BBE636C8243FB205000E01F0 /* generala.app */, + ); + name = Products; + sourceTree = ""; + }; + BBE636CA243FB205000E01F0 /* generala */ = { + isa = PBXGroup; + children = ( + BBE636CB243FB205000E01F0 /* AppDelegate.swift */, + BBE636CD243FB205000E01F0 /* SceneDelegate.swift */, + BBE636CF243FB205000E01F0 /* ViewController.swift */, + BBE636D1243FB205000E01F0 /* Main.storyboard */, + BBE636D4243FB208000E01F0 /* Assets.xcassets */, + BBE636D6243FB208000E01F0 /* LaunchScreen.storyboard */, + BBE636D9243FB208000E01F0 /* Info.plist */, + BBE636DF243FB25D000E01F0 /* Dado.swift */, + ); + path = generala; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + BBE636C7243FB205000E01F0 /* generala */ = { + isa = PBXNativeTarget; + buildConfigurationList = BBE636DC243FB208000E01F0 /* Build configuration list for PBXNativeTarget "generala" */; + buildPhases = ( + BBE636C4243FB205000E01F0 /* Sources */, + BBE636C5243FB205000E01F0 /* Frameworks */, + BBE636C6243FB205000E01F0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = generala; + productName = generala; + productReference = BBE636C8243FB205000E01F0 /* generala.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BBE636C0243FB204000E01F0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1110; + LastUpgradeCheck = 1110; + ORGANIZATIONNAME = "Mobile Roshka"; + TargetAttributes = { + BBE636C7243FB205000E01F0 = { + CreatedOnToolsVersion = 11.1; + }; + }; + }; + buildConfigurationList = BBE636C3243FB204000E01F0 /* Build configuration list for PBXProject "generala" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = BBE636BF243FB204000E01F0; + productRefGroup = BBE636C9243FB205000E01F0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + BBE636C7243FB205000E01F0 /* generala */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + BBE636C6243FB205000E01F0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BBE636D8243FB208000E01F0 /* LaunchScreen.storyboard in Resources */, + BBE636D5243FB208000E01F0 /* Assets.xcassets in Resources */, + BBE636D3243FB205000E01F0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + BBE636C4243FB205000E01F0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BBE636D0243FB205000E01F0 /* ViewController.swift in Sources */, + BBE636E0243FB25D000E01F0 /* Dado.swift in Sources */, + BBE636CC243FB205000E01F0 /* AppDelegate.swift in Sources */, + BBE636CE243FB205000E01F0 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + BBE636D1243FB205000E01F0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BBE636D2243FB205000E01F0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + BBE636D6243FB208000E01F0 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BBE636D7243FB208000E01F0 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + BBE636DA243FB208000E01F0 /* 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; + }; + BBE636DB243FB208000E01F0 /* 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; + }; + BBE636DD243FB208000E01F0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = generala/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = roshka.generala; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + BBE636DE243FB208000E01F0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = generala/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = roshka.generala; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BBE636C3243FB204000E01F0 /* Build configuration list for PBXProject "generala" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BBE636DA243FB208000E01F0 /* Debug */, + BBE636DB243FB208000E01F0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BBE636DC243FB208000E01F0 /* Build configuration list for PBXNativeTarget "generala" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BBE636DD243FB208000E01F0 /* Debug */, + BBE636DE243FB208000E01F0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BBE636C0243FB204000E01F0 /* Project object */; +} diff --git b/generala/generala.xcodeproj/project.xcworkspace/contents.xcworkspacedata a/generala/generala.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..dfb9e7a --- /dev/null +++ a/generala/generala.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git b/generala/generala.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist a/generala/generala.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ a/generala/generala.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git b/generala/generala.xcodeproj/project.xcworkspace/xcuserdata/roshka.xcuserdatad/UserInterfaceState.xcuserstate a/generala/generala.xcodeproj/project.xcworkspace/xcuserdata/roshka.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..c2357e3 Binary files /dev/null and a/generala/generala.xcodeproj/project.xcworkspace/xcuserdata/roshka.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git b/generala/generala.xcodeproj/xcuserdata/roshka.xcuserdatad/xcschemes/xcschememanagement.plist a/generala/generala.xcodeproj/xcuserdata/roshka.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6bc303b --- /dev/null +++ a/generala/generala.xcodeproj/xcuserdata/roshka.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + generala.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git b/generala/generala/AppDelegate.swift a/generala/generala/AppDelegate.swift new file mode 100644 index 0000000..822ee84 --- /dev/null +++ a/generala/generala/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// generala +// +// Created by Mobile Roshka on 4/9/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) { + // 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. + } + + +} + diff --git b/generala/generala/Assets.xcassets/AppIcon.appiconset/Contents.json a/generala/generala/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ a/generala/generala/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "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 diff --git b/generala/generala/Assets.xcassets/Contents.json a/generala/generala/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ a/generala/generala/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/generala/generala/Assets.xcassets/dado-1.imageset/Contents.json a/generala/generala/Assets.xcassets/dado-1.imageset/Contents.json new file mode 100644 index 0000000..008c213 --- /dev/null +++ a/generala/generala/Assets.xcassets/dado-1.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "dado-1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/generala/generala/Assets.xcassets/dado-1.imageset/dado-1.png a/generala/generala/Assets.xcassets/dado-1.imageset/dado-1.png new file mode 100644 index 0000000..baf043a Binary files /dev/null and a/generala/generala/Assets.xcassets/dado-1.imageset/dado-1.png differ diff --git b/generala/generala/Assets.xcassets/dado-2.imageset/Contents.json a/generala/generala/Assets.xcassets/dado-2.imageset/Contents.json new file mode 100644 index 0000000..3d653e5 --- /dev/null +++ a/generala/generala/Assets.xcassets/dado-2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "dado-2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/generala/generala/Assets.xcassets/dado-2.imageset/dado-2.png a/generala/generala/Assets.xcassets/dado-2.imageset/dado-2.png new file mode 100644 index 0000000..718fb94 Binary files /dev/null and a/generala/generala/Assets.xcassets/dado-2.imageset/dado-2.png differ diff --git b/generala/generala/Assets.xcassets/dado-3.imageset/Contents.json a/generala/generala/Assets.xcassets/dado-3.imageset/Contents.json new file mode 100644 index 0000000..d006adb --- /dev/null +++ a/generala/generala/Assets.xcassets/dado-3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "dado-3.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/generala/generala/Assets.xcassets/dado-3.imageset/dado-3.png a/generala/generala/Assets.xcassets/dado-3.imageset/dado-3.png new file mode 100644 index 0000000..2acc597 Binary files /dev/null and a/generala/generala/Assets.xcassets/dado-3.imageset/dado-3.png differ diff --git b/generala/generala/Assets.xcassets/dado-4.imageset/Contents.json a/generala/generala/Assets.xcassets/dado-4.imageset/Contents.json new file mode 100644 index 0000000..a554813 --- /dev/null +++ a/generala/generala/Assets.xcassets/dado-4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "dado-4.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/generala/generala/Assets.xcassets/dado-4.imageset/dado-4.png a/generala/generala/Assets.xcassets/dado-4.imageset/dado-4.png new file mode 100644 index 0000000..ca6a9f1 Binary files /dev/null and a/generala/generala/Assets.xcassets/dado-4.imageset/dado-4.png differ diff --git b/generala/generala/Assets.xcassets/dado-5.imageset/Contents.json a/generala/generala/Assets.xcassets/dado-5.imageset/Contents.json new file mode 100644 index 0000000..654f640 --- /dev/null +++ a/generala/generala/Assets.xcassets/dado-5.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "dado-5.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/generala/generala/Assets.xcassets/dado-5.imageset/dado-5.png a/generala/generala/Assets.xcassets/dado-5.imageset/dado-5.png new file mode 100644 index 0000000..31660f4 Binary files /dev/null and a/generala/generala/Assets.xcassets/dado-5.imageset/dado-5.png differ diff --git b/generala/generala/Assets.xcassets/dado-6.imageset/Contents.json a/generala/generala/Assets.xcassets/dado-6.imageset/Contents.json new file mode 100644 index 0000000..0475a5e --- /dev/null +++ a/generala/generala/Assets.xcassets/dado-6.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "dado-6.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/generala/generala/Assets.xcassets/dado-6.imageset/dado-6.png a/generala/generala/Assets.xcassets/dado-6.imageset/dado-6.png new file mode 100644 index 0000000..a32dd7e Binary files /dev/null and a/generala/generala/Assets.xcassets/dado-6.imageset/dado-6.png differ diff --git b/generala/generala/Assets.xcassets/dado-logo.imageset/Contents.json a/generala/generala/Assets.xcassets/dado-logo.imageset/Contents.json new file mode 100644 index 0000000..8f21391 --- /dev/null +++ a/generala/generala/Assets.xcassets/dado-logo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "dado-logo.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/generala/generala/Assets.xcassets/dado-logo.imageset/dado-logo.png a/generala/generala/Assets.xcassets/dado-logo.imageset/dado-logo.png new file mode 100644 index 0000000..9f6a6d9 Binary files /dev/null and a/generala/generala/Assets.xcassets/dado-logo.imageset/dado-logo.png differ diff --git b/generala/generala/Base.lproj/LaunchScreen.storyboard a/generala/generala/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ a/generala/generala/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git b/generala/generala/Base.lproj/Main.storyboard a/generala/generala/Base.lproj/Main.storyboard new file mode 100644 index 0000000..039d8b3 --- /dev/null +++ a/generala/generala/Base.lproj/Main.storyboard @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git b/generala/generala/Dado.swift a/generala/generala/Dado.swift new file mode 100644 index 0000000..bc25020 --- /dev/null +++ a/generala/generala/Dado.swift @@ -0,0 +1,96 @@ +// +// Dado.swift +// generala +// +// Created by Julio Hermosa on 4/9/20. +// Copyright © 2020 Mobile Roshka. All rights reserved. +// + +import Foundation + + +class Dado{ + // + var resultado = [Int]()//El array se carga al llamar a la función lanzarDado, con valores aleatorios del 1 al 6 (caras del dado). Cada posición de éste vector corresponde a un dado. + var valores: [Int: Int] = [1: 0, 2:0, 3:0, 4:0, 5:0, 6:0]//Diccionario con cada uno de los valores posibles de 'resultado', contabilizando las veces que se repiten los valores + + //Para cargar los valores del array resultado de manera manual + //var resultado: [Int] = [1,2,3,5,4] + + var resultadoOrdenado = [Int]()//Se ordena el array 'resultado' de manera creciente + + //Los siguientes diccionarios resultan a realizar un filtro del diccionario de valores + var par = [Int:Int]() // Cantidad de pares y sus valores, se utiliza para la combinación 'Full' + var trio = [Int:Int]() // Valores que aparecen en 3 ocasiones + var poker = [Int:Int]() // Valores que aparecen en 4 ocasiones + var generala = [Int:Int]() // Valores que aparecen en 5 ocasiones + var retorno = "Nada" // Ninguna combinación + + //Simulamos el lanzamiento de 5 dados, cuyos resultados se cargan en el array 'resultado' y en el diccionario de valores + func lanzarDado(){ + //var resultado = [Int]() + + //Cargamos los arrays de resultado + for index in 0...4{ + resultado.append(Int.random(in: 1...6)) + resultadoOrdenado.append(resultado[index]) + } + + //ordenamos el resultado + resultadoOrdenado.sort() + + //Recorremos el array contabilizando repeticiones de valores + for i in 1...4 { + if valores[resultadoOrdenado[i]] == 0{ + valores[resultadoOrdenado[i]]! += 1 + } + if resultadoOrdenado[i] == resultadoOrdenado[i-1]{ + valores[resultadoOrdenado[i]]! += 1 + } + + } + + + //filtramos el diccionario de valores segun su cantidad cargando en su combinación correspondiente + par = valores.filter { $0.value == 2} + trio = valores.filter { $0.value == 3} + poker = valores.filter { $0.value == 4} + generala = valores.filter { $0.value == 5} + + //print (resultado) + //print (resultadoOrdenado) + + } + + //La función obtenerResultado devuelve el nombre de la combinación obtenida + func obtenerResultado()->String{ + + if trio.count == 1 && par.count == 1{ + retorno = "Full" + } + if poker.count == 1{ + retorno = "Poker" + } + if generala.count == 1{ + retorno = "Generala" + } + let escaleraMenor: [Int] = [1, 2, 3, 4, 5] + let escalera: [Int] = [2, 3, 4, 5, 6] + let escaleraMayor: [Int] = [3, 4, 5, 6, 1] + if resultadoOrdenado == escaleraMenor || resultadoOrdenado == escalera || resultadoOrdenado == escaleraMayor{ + retorno = "Escalera" + } + return retorno + } + + //Removemos todos los valores obtenidos por el usuario para volver a jugar + func reiniciar(){ + resultado.removeAll() + resultadoOrdenado.removeAll() + for index in 1...6 { + valores[index] = 0 + } + retorno = "Nada" + + } +} diff --git b/generala/generala/Info.plist a/generala/generala/Info.plist new file mode 100644 index 0000000..2a3483c --- /dev/null +++ a/generala/generala/Info.plist @@ -0,0 +1,64 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git b/generala/generala/SceneDelegate.swift a/generala/generala/SceneDelegate.swift new file mode 100644 index 0000000..85f28ad --- /dev/null +++ a/generala/generala/SceneDelegate.swift @@ -0,0 +1,53 @@ +// +// SceneDelegate.swift +// generala +// +// Created by Mobile Roshka on 4/9/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. + } + + +} + diff --git b/generala/generala/ViewController.swift a/generala/generala/ViewController.swift new file mode 100644 index 0000000..ee5f8a0 --- /dev/null +++ a/generala/generala/ViewController.swift @@ -0,0 +1,53 @@ +// +// ViewController.swift +// generala +// +// Created by Julio Hermosa on 4/9/20. +// Copyright © 2020 Mobile Roshka. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + //inicializamos un dado, del tipo Dado + var dado = Dado.init() + + @IBOutlet weak var jugarBtn: UIButton! + + //Se cargan las imagenes de los dados segun el resultado obtenido + @IBOutlet weak var dado1: UIImageView! + @IBOutlet weak var dado2: UIImageView! + @IBOutlet weak var dado3: UIImageView! + @IBOutlet weak var dado4: UIImageView! + @IBOutlet weak var dado5: UIImageView! + + //Botón para iniciar juego, llama a la función jugar + @IBAction func jugarBtnAction(_ sender: Any) { + jugar() + } + + @IBOutlet weak var resultadoLbl: UILabel! + + + //Función jugar, se realizan las operaciones de lanzamiento de los dados, carga de imagenes de los dados y se imprime si hay alguna combinación en el label resultadoLbl + func jugar(){ + dado.lanzarDado() //Se carga el resultado de los lanzamientos + //print(dado.obtenerResultado()) + resultadoLbl.text = dado.obtenerResultado() + dado1.image = UIImage(named: "dado-\(dado.resultado[0])") + dado2.image = UIImage(named: "dado-\(dado.resultado[1])") + dado3.image = UIImage(named: "dado-\(dado.resultado[2])") + dado4.image = UIImage(named: "dado-\(dado.resultado[3])") + dado5.image = UIImage(named: "dado-\(dado.resultado[4])") + dado.reiniciar()//Borramos todos los datos del usuario para que se pueda volver a jugar + + + } + override func viewDidLoad() { + super.viewDidLoad() + } + + +} +