├── .github ├── FUNDING.yml ├── assets │ ├── Game.png │ ├── Help.png │ ├── Result.png │ └── Settings.png └── workflows │ └── swift.yml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── Package.swift ├── README.md ├── Sources └── Wordle-Like-iOS-Game │ └── Wordle_Like_iOS_Game.swift ├── Tests └── Wordle-Like-iOS-GameTests │ └── Wordle_Like_iOS_GameTests.swift ├── Wordle-Like-iOS-Game.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcshareddata │ └── xcschemes │ │ └── Wordle-Like-iOS-Game.xcscheme └── xcuserdata │ └── ricky.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── Wordle-Like-iOS-Game ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── Animal5.dataset │ ├── Animal5.txt │ └── Contents.json ├── Animal6.dataset │ ├── Animal6.txt │ └── Contents.json ├── Animal7.dataset │ ├── Animal7.txt │ └── Contents.json ├── AppIcon.appiconset │ ├── 1024.png │ ├── 120-1.png │ ├── 120.png │ ├── 152.png │ ├── 167.png │ ├── 180.png │ ├── 20.png │ ├── 29.png │ ├── 40-1.png │ ├── 40-2.png │ ├── 40.png │ ├── 58-1.png │ ├── 58.png │ ├── 60.png │ ├── 76.png │ ├── 80-1.png │ ├── 80.png │ ├── 87.png │ └── Contents.json ├── Contents.json ├── Fruit&Food5.dataset │ ├── Contents.json │ └── Fruit&Food5.txt ├── Fruit&Food6.dataset │ ├── Contents.json │ └── Fruit&Food6.txt └── Fruit&Food7.dataset │ ├── Contents.json │ └── Fruit&Food7.txt ├── ColorExtension.swift ├── ContentView.swift ├── GameGridsView.swift ├── GameTypeView.swift ├── HowToPlayView.swift ├── KeyBoardView.swift ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json ├── ResultView.swift ├── SafariView.swift ├── SettingsView.swift ├── TitleView.swift ├── Wordle.swift └── Wordle_Like_iOS_GameApp.swift /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['paypal.me/5j54d93', 'ethereum/0xf43b3B8B734A9aD9B9e18DBf1882053CC6D623de'] 2 | -------------------------------------------------------------------------------- /.github/assets/Game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/.github/assets/Game.png -------------------------------------------------------------------------------- /.github/assets/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/.github/assets/Help.png -------------------------------------------------------------------------------- /.github/assets/Result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/.github/assets/Result.png -------------------------------------------------------------------------------- /.github/assets/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/.github/assets/Settings.png -------------------------------------------------------------------------------- /.github/workflows/swift.yml: -------------------------------------------------------------------------------- 1 | name: Swift 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: macos-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v3 16 | - name: Build 17 | run: swift build -v 18 | - name: Run tests 19 | run: swift test -v 20 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | songsongyyohya@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Ricky Chuang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "Wordle-Like-iOS-Game", 8 | products: [ 9 | // Products define the executables and libraries a package produces, and make them visible to other packages. 10 | .library( 11 | name: "Wordle-Like-iOS-Game", 12 | targets: ["Wordle-Like-iOS-Game"]), 13 | ], 14 | dependencies: [ 15 | // Dependencies declare other packages that this package depends on. 16 | // .package(url: /* package url */, from: "1.0.0"), 17 | ], 18 | targets: [ 19 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 20 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 21 | .target( 22 | name: "Wordle-Like-iOS-Game", 23 | dependencies: []), 24 | .testTarget( 25 | name: "Wordle-Like-iOS-GameTests", 26 | dependencies: ["Wordle-Like-iOS-Game"]), 27 | ] 28 | ) 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Wordle Like iOS Game 2 | 3 | [![Swift](https://github.com/5j54d93/Wordle-Like-iOS-Game/actions/workflows/swift.yml/badge.svg)](https://github.com/5j54d93/Wordle-Like-iOS-Game/actions/workflows/swift.yml) 4 | [![GitHub license](https://img.shields.io/github/license/5j54d93/Wordle-Like-iOS-Game)](https://github.com/5j54d93/Wordle-Like-iOS-Game/blob/main/LICENSE) 5 | ![GitHub Repo stars](https://img.shields.io/github/stars/5j54d93/Wordle-Like-iOS-Game) 6 | ![GitHub repo size](https://img.shields.io/github/repo-size/5j54d93/Wordle-Like-iOS-Game) 7 | ![Platform](https://img.shields.io/badge/platform-iOS|iPadOS|macOS-lightgrey) 8 | 9 | [**Wordle Like iOS Game**](https://github.com/5j54d93/Wordle-Like-iOS-Game) designed with [**SwiftUI**](https://developer.apple.com/xcode/swiftui/) that could: 10 | 11 | - change word length、word topic、grid color 12 | - store score in `@AppStorage` 13 | - share Wordle record by `UIPasteboard.general.string` 14 | - a new WORDLE will be available each 5 minutes 15 | 16 | > **iOS**:iPhone 13 Pro Max 17 | 18 | 19 | 20 | ## How To Play 21 | 22 | 1. Simply click on the green「Code」button on top right 23 | 2. click「Open with Xcode」 24 | 3. Having fun to play this Wordle like iOS game! 25 | 26 | if nothing happen: 27 | 28 | - Download this repository via `git clone` 29 | 30 | ```shell 31 | git clone https://github.com/5j54d93/Wordle-Like-iOS-Game 32 | ``` 33 | 34 | ## License:MIT 35 | 36 | This package is [MIT licensed](https://github.com/5j54d93/Wordle-Like-iOS-Game/blob/main/LICENSE). 37 | -------------------------------------------------------------------------------- /Sources/Wordle-Like-iOS-Game/Wordle_Like_iOS_Game.swift: -------------------------------------------------------------------------------- 1 | public struct Wordle_Like_iOS_Game { 2 | public private(set) var text = "Hello, World!" 3 | 4 | public init() { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Tests/Wordle-Like-iOS-GameTests/Wordle_Like_iOS_GameTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import Wordle_Like_iOS_Game 3 | 4 | final class Wordle_Like_iOS_GameTests: XCTestCase { 5 | func testExample() throws { 6 | // This is an example of a functional test case. 7 | // Use XCTAssert and related functions to verify your tests produce the correct 8 | // results. 9 | XCTAssertEqual(Wordle_Like_iOS_Game().text, "Hello, World!") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9C222DB927F362C600E07244 /* TitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C222DB827F362C600E07244 /* TitleView.swift */; }; 11 | 9C222DBB27F364F700E07244 /* GameTypeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C222DBA27F364F700E07244 /* GameTypeView.swift */; }; 12 | 9C222DBD27F367C900E07244 /* GameGridsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C222DBC27F367C900E07244 /* GameGridsView.swift */; }; 13 | 9C222DBF27F36DE900E07244 /* KeyBoardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C222DBE27F36DE900E07244 /* KeyBoardView.swift */; }; 14 | 9C222DC127F3840700E07244 /* ColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C222DC027F3840700E07244 /* ColorExtension.swift */; }; 15 | 9C222DC327F384DC00E07244 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C222DC227F384DC00E07244 /* SettingsView.swift */; }; 16 | 9C222DC527F411FA00E07244 /* Wordle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C222DC427F411FA00E07244 /* Wordle.swift */; }; 17 | 9C86990A27F35DDE00D602A6 /* Wordle_Like_iOS_GameApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C86990927F35DDE00D602A6 /* Wordle_Like_iOS_GameApp.swift */; }; 18 | 9C86990C27F35DDE00D602A6 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C86990B27F35DDE00D602A6 /* ContentView.swift */; }; 19 | 9C86990E27F35DDF00D602A6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C86990D27F35DDF00D602A6 /* Assets.xcassets */; }; 20 | 9C86991127F35DDF00D602A6 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C86991027F35DDF00D602A6 /* Preview Assets.xcassets */; }; 21 | 9CB0E7ED27F45564008377A1 /* ResultView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CB0E7EC27F45564008377A1 /* ResultView.swift */; }; 22 | 9CC935F627F49C2E004BC1C7 /* HowToPlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CC935F527F49C2E004BC1C7 /* HowToPlayView.swift */; }; 23 | 9CC935F827F4B64A004BC1C7 /* SafariView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CC935F727F4B649004BC1C7 /* SafariView.swift */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 9C222DB827F362C600E07244 /* TitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleView.swift; sourceTree = ""; }; 28 | 9C222DBA27F364F700E07244 /* GameTypeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameTypeView.swift; sourceTree = ""; }; 29 | 9C222DBC27F367C900E07244 /* GameGridsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameGridsView.swift; sourceTree = ""; }; 30 | 9C222DBE27F36DE900E07244 /* KeyBoardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBoardView.swift; sourceTree = ""; }; 31 | 9C222DC027F3840700E07244 /* ColorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorExtension.swift; sourceTree = ""; }; 32 | 9C222DC227F384DC00E07244 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; 33 | 9C222DC427F411FA00E07244 /* Wordle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Wordle.swift; sourceTree = ""; }; 34 | 9C86990627F35DDE00D602A6 /* Wordle.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Wordle.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 9C86990927F35DDE00D602A6 /* Wordle_Like_iOS_GameApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Wordle_Like_iOS_GameApp.swift; sourceTree = ""; }; 36 | 9C86990B27F35DDE00D602A6 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 37 | 9C86990D27F35DDF00D602A6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 38 | 9C86991027F35DDF00D602A6 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 39 | 9CB0E7EC27F45564008377A1 /* ResultView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultView.swift; sourceTree = ""; }; 40 | 9CC935F527F49C2E004BC1C7 /* HowToPlayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HowToPlayView.swift; sourceTree = ""; }; 41 | 9CC935F727F4B649004BC1C7 /* SafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariView.swift; sourceTree = ""; }; 42 | /* End PBXFileReference section */ 43 | 44 | /* Begin PBXFrameworksBuildPhase section */ 45 | 9C86990327F35DDE00D602A6 /* Frameworks */ = { 46 | isa = PBXFrameworksBuildPhase; 47 | buildActionMask = 2147483647; 48 | files = ( 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXFrameworksBuildPhase section */ 53 | 54 | /* Begin PBXGroup section */ 55 | 9C8698FD27F35DDE00D602A6 = { 56 | isa = PBXGroup; 57 | children = ( 58 | 9C86990827F35DDE00D602A6 /* Wordle-Like-iOS-Game */, 59 | 9C86990727F35DDE00D602A6 /* Products */, 60 | ); 61 | sourceTree = ""; 62 | }; 63 | 9C86990727F35DDE00D602A6 /* Products */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | 9C86990627F35DDE00D602A6 /* Wordle.app */, 67 | ); 68 | name = Products; 69 | sourceTree = ""; 70 | }; 71 | 9C86990827F35DDE00D602A6 /* Wordle-Like-iOS-Game */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 9C86990927F35DDE00D602A6 /* Wordle_Like_iOS_GameApp.swift */, 75 | 9C86990B27F35DDE00D602A6 /* ContentView.swift */, 76 | 9C222DB827F362C600E07244 /* TitleView.swift */, 77 | 9C222DBA27F364F700E07244 /* GameTypeView.swift */, 78 | 9C222DBC27F367C900E07244 /* GameGridsView.swift */, 79 | 9C222DBE27F36DE900E07244 /* KeyBoardView.swift */, 80 | 9CB0E7EC27F45564008377A1 /* ResultView.swift */, 81 | 9C222DC227F384DC00E07244 /* SettingsView.swift */, 82 | 9CC935F527F49C2E004BC1C7 /* HowToPlayView.swift */, 83 | 9CC935F727F4B649004BC1C7 /* SafariView.swift */, 84 | 9C222DC427F411FA00E07244 /* Wordle.swift */, 85 | 9C222DC027F3840700E07244 /* ColorExtension.swift */, 86 | 9C86990D27F35DDF00D602A6 /* Assets.xcassets */, 87 | 9C86990F27F35DDF00D602A6 /* Preview Content */, 88 | ); 89 | path = "Wordle-Like-iOS-Game"; 90 | sourceTree = ""; 91 | }; 92 | 9C86990F27F35DDF00D602A6 /* Preview Content */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 9C86991027F35DDF00D602A6 /* Preview Assets.xcassets */, 96 | ); 97 | path = "Preview Content"; 98 | sourceTree = ""; 99 | }; 100 | /* End PBXGroup section */ 101 | 102 | /* Begin PBXNativeTarget section */ 103 | 9C86990527F35DDE00D602A6 /* Wordle-Like-iOS-Game */ = { 104 | isa = PBXNativeTarget; 105 | buildConfigurationList = 9C86991427F35DDF00D602A6 /* Build configuration list for PBXNativeTarget "Wordle-Like-iOS-Game" */; 106 | buildPhases = ( 107 | 9C86990227F35DDE00D602A6 /* Sources */, 108 | 9C86990327F35DDE00D602A6 /* Frameworks */, 109 | 9C86990427F35DDE00D602A6 /* Resources */, 110 | ); 111 | buildRules = ( 112 | ); 113 | dependencies = ( 114 | ); 115 | name = "Wordle-Like-iOS-Game"; 116 | productName = "Wordle-Like-iOS-Game"; 117 | productReference = 9C86990627F35DDE00D602A6 /* Wordle.app */; 118 | productType = "com.apple.product-type.application"; 119 | }; 120 | /* End PBXNativeTarget section */ 121 | 122 | /* Begin PBXProject section */ 123 | 9C8698FE27F35DDE00D602A6 /* Project object */ = { 124 | isa = PBXProject; 125 | attributes = { 126 | BuildIndependentTargetsInParallel = 1; 127 | LastSwiftUpdateCheck = 1330; 128 | LastUpgradeCheck = 1330; 129 | TargetAttributes = { 130 | 9C86990527F35DDE00D602A6 = { 131 | CreatedOnToolsVersion = 13.3; 132 | }; 133 | }; 134 | }; 135 | buildConfigurationList = 9C86990127F35DDE00D602A6 /* Build configuration list for PBXProject "Wordle-Like-iOS-Game" */; 136 | compatibilityVersion = "Xcode 13.0"; 137 | developmentRegion = en; 138 | hasScannedForEncodings = 0; 139 | knownRegions = ( 140 | en, 141 | Base, 142 | ); 143 | mainGroup = 9C8698FD27F35DDE00D602A6; 144 | productRefGroup = 9C86990727F35DDE00D602A6 /* Products */; 145 | projectDirPath = ""; 146 | projectRoot = ""; 147 | targets = ( 148 | 9C86990527F35DDE00D602A6 /* Wordle-Like-iOS-Game */, 149 | ); 150 | }; 151 | /* End PBXProject section */ 152 | 153 | /* Begin PBXResourcesBuildPhase section */ 154 | 9C86990427F35DDE00D602A6 /* Resources */ = { 155 | isa = PBXResourcesBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 9C86991127F35DDF00D602A6 /* Preview Assets.xcassets in Resources */, 159 | 9C86990E27F35DDF00D602A6 /* Assets.xcassets in Resources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXResourcesBuildPhase section */ 164 | 165 | /* Begin PBXSourcesBuildPhase section */ 166 | 9C86990227F35DDE00D602A6 /* Sources */ = { 167 | isa = PBXSourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | 9C222DC527F411FA00E07244 /* Wordle.swift in Sources */, 171 | 9C222DBB27F364F700E07244 /* GameTypeView.swift in Sources */, 172 | 9C222DC327F384DC00E07244 /* SettingsView.swift in Sources */, 173 | 9CC935F627F49C2E004BC1C7 /* HowToPlayView.swift in Sources */, 174 | 9CC935F827F4B64A004BC1C7 /* SafariView.swift in Sources */, 175 | 9C86990C27F35DDE00D602A6 /* ContentView.swift in Sources */, 176 | 9C222DBD27F367C900E07244 /* GameGridsView.swift in Sources */, 177 | 9C222DBF27F36DE900E07244 /* KeyBoardView.swift in Sources */, 178 | 9C86990A27F35DDE00D602A6 /* Wordle_Like_iOS_GameApp.swift in Sources */, 179 | 9CB0E7ED27F45564008377A1 /* ResultView.swift in Sources */, 180 | 9C222DC127F3840700E07244 /* ColorExtension.swift in Sources */, 181 | 9C222DB927F362C600E07244 /* TitleView.swift in Sources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXSourcesBuildPhase section */ 186 | 187 | /* Begin XCBuildConfiguration section */ 188 | 9C86991227F35DDF00D602A6 /* Debug */ = { 189 | isa = XCBuildConfiguration; 190 | buildSettings = { 191 | ALWAYS_SEARCH_USER_PATHS = NO; 192 | CLANG_ANALYZER_NONNULL = YES; 193 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 194 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 195 | CLANG_ENABLE_MODULES = YES; 196 | CLANG_ENABLE_OBJC_ARC = YES; 197 | CLANG_ENABLE_OBJC_WEAK = YES; 198 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 199 | CLANG_WARN_BOOL_CONVERSION = YES; 200 | CLANG_WARN_COMMA = YES; 201 | CLANG_WARN_CONSTANT_CONVERSION = YES; 202 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 203 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 204 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 205 | CLANG_WARN_EMPTY_BODY = YES; 206 | CLANG_WARN_ENUM_CONVERSION = YES; 207 | CLANG_WARN_INFINITE_RECURSION = YES; 208 | CLANG_WARN_INT_CONVERSION = YES; 209 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 210 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 211 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 212 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 213 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 214 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 215 | CLANG_WARN_STRICT_PROTOTYPES = YES; 216 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 217 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 218 | CLANG_WARN_UNREACHABLE_CODE = YES; 219 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 220 | COPY_PHASE_STRIP = NO; 221 | DEBUG_INFORMATION_FORMAT = dwarf; 222 | ENABLE_STRICT_OBJC_MSGSEND = YES; 223 | ENABLE_TESTABILITY = YES; 224 | GCC_C_LANGUAGE_STANDARD = gnu11; 225 | GCC_DYNAMIC_NO_PIC = NO; 226 | GCC_NO_COMMON_BLOCKS = YES; 227 | GCC_OPTIMIZATION_LEVEL = 0; 228 | GCC_PREPROCESSOR_DEFINITIONS = ( 229 | "DEBUG=1", 230 | "$(inherited)", 231 | ); 232 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 233 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 234 | GCC_WARN_UNDECLARED_SELECTOR = YES; 235 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 236 | GCC_WARN_UNUSED_FUNCTION = YES; 237 | GCC_WARN_UNUSED_VARIABLE = YES; 238 | IPHONEOS_DEPLOYMENT_TARGET = 15.4; 239 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 240 | MTL_FAST_MATH = YES; 241 | ONLY_ACTIVE_ARCH = YES; 242 | SDKROOT = iphoneos; 243 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 244 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 245 | }; 246 | name = Debug; 247 | }; 248 | 9C86991327F35DDF00D602A6 /* Release */ = { 249 | isa = XCBuildConfiguration; 250 | buildSettings = { 251 | ALWAYS_SEARCH_USER_PATHS = NO; 252 | CLANG_ANALYZER_NONNULL = YES; 253 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 254 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 255 | CLANG_ENABLE_MODULES = YES; 256 | CLANG_ENABLE_OBJC_ARC = YES; 257 | CLANG_ENABLE_OBJC_WEAK = YES; 258 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 259 | CLANG_WARN_BOOL_CONVERSION = YES; 260 | CLANG_WARN_COMMA = YES; 261 | CLANG_WARN_CONSTANT_CONVERSION = YES; 262 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 263 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 264 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 265 | CLANG_WARN_EMPTY_BODY = YES; 266 | CLANG_WARN_ENUM_CONVERSION = YES; 267 | CLANG_WARN_INFINITE_RECURSION = YES; 268 | CLANG_WARN_INT_CONVERSION = YES; 269 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 270 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 271 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 272 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 273 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 274 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 275 | CLANG_WARN_STRICT_PROTOTYPES = YES; 276 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 277 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 278 | CLANG_WARN_UNREACHABLE_CODE = YES; 279 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 280 | COPY_PHASE_STRIP = NO; 281 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 282 | ENABLE_NS_ASSERTIONS = NO; 283 | ENABLE_STRICT_OBJC_MSGSEND = YES; 284 | GCC_C_LANGUAGE_STANDARD = gnu11; 285 | GCC_NO_COMMON_BLOCKS = YES; 286 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 287 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 288 | GCC_WARN_UNDECLARED_SELECTOR = YES; 289 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 290 | GCC_WARN_UNUSED_FUNCTION = YES; 291 | GCC_WARN_UNUSED_VARIABLE = YES; 292 | IPHONEOS_DEPLOYMENT_TARGET = 15.4; 293 | MTL_ENABLE_DEBUG_INFO = NO; 294 | MTL_FAST_MATH = YES; 295 | SDKROOT = iphoneos; 296 | SWIFT_COMPILATION_MODE = wholemodule; 297 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 298 | VALIDATE_PRODUCT = YES; 299 | }; 300 | name = Release; 301 | }; 302 | 9C86991527F35DDF00D602A6 /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 306 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 307 | CODE_SIGN_STYLE = Automatic; 308 | CURRENT_PROJECT_VERSION = 1; 309 | DEVELOPMENT_ASSET_PATHS = "\"Wordle-Like-iOS-Game/Preview Content\""; 310 | DEVELOPMENT_TEAM = 24SCJHS57L; 311 | ENABLE_PREVIEWS = YES; 312 | GENERATE_INFOPLIST_FILE = YES; 313 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 314 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 315 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 316 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 317 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 318 | LD_RUNPATH_SEARCH_PATHS = ( 319 | "$(inherited)", 320 | "@executable_path/Frameworks", 321 | ); 322 | MARKETING_VERSION = 1.0; 323 | PRODUCT_BUNDLE_IDENTIFIER = "edu.Ricky-Chuang.Wordle-Like-iOS-Game"; 324 | PRODUCT_NAME = Wordle; 325 | SWIFT_EMIT_LOC_STRINGS = YES; 326 | SWIFT_VERSION = 5.0; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | }; 329 | name = Debug; 330 | }; 331 | 9C86991627F35DDF00D602A6 /* Release */ = { 332 | isa = XCBuildConfiguration; 333 | buildSettings = { 334 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 335 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 336 | CODE_SIGN_STYLE = Automatic; 337 | CURRENT_PROJECT_VERSION = 1; 338 | DEVELOPMENT_ASSET_PATHS = "\"Wordle-Like-iOS-Game/Preview Content\""; 339 | DEVELOPMENT_TEAM = 24SCJHS57L; 340 | ENABLE_PREVIEWS = YES; 341 | GENERATE_INFOPLIST_FILE = YES; 342 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 343 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 344 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 345 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 346 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 347 | LD_RUNPATH_SEARCH_PATHS = ( 348 | "$(inherited)", 349 | "@executable_path/Frameworks", 350 | ); 351 | MARKETING_VERSION = 1.0; 352 | PRODUCT_BUNDLE_IDENTIFIER = "edu.Ricky-Chuang.Wordle-Like-iOS-Game"; 353 | PRODUCT_NAME = Wordle; 354 | SWIFT_EMIT_LOC_STRINGS = YES; 355 | SWIFT_VERSION = 5.0; 356 | TARGETED_DEVICE_FAMILY = "1,2"; 357 | }; 358 | name = Release; 359 | }; 360 | /* End XCBuildConfiguration section */ 361 | 362 | /* Begin XCConfigurationList section */ 363 | 9C86990127F35DDE00D602A6 /* Build configuration list for PBXProject "Wordle-Like-iOS-Game" */ = { 364 | isa = XCConfigurationList; 365 | buildConfigurations = ( 366 | 9C86991227F35DDF00D602A6 /* Debug */, 367 | 9C86991327F35DDF00D602A6 /* Release */, 368 | ); 369 | defaultConfigurationIsVisible = 0; 370 | defaultConfigurationName = Release; 371 | }; 372 | 9C86991427F35DDF00D602A6 /* Build configuration list for PBXNativeTarget "Wordle-Like-iOS-Game" */ = { 373 | isa = XCConfigurationList; 374 | buildConfigurations = ( 375 | 9C86991527F35DDF00D602A6 /* Debug */, 376 | 9C86991627F35DDF00D602A6 /* Release */, 377 | ); 378 | defaultConfigurationIsVisible = 0; 379 | defaultConfigurationName = Release; 380 | }; 381 | /* End XCConfigurationList section */ 382 | }; 383 | rootObject = 9C8698FE27F35DDE00D602A6 /* Project object */; 384 | } 385 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game.xcodeproj/xcshareddata/xcschemes/Wordle-Like-iOS-Game.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 58 | 59 | 60 | 61 | 67 | 69 | 75 | 76 | 77 | 78 | 80 | 81 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game.xcodeproj/xcuserdata/ricky.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Wordle-Like-iOS-Game.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 9C86990527F35DDE00D602A6 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Animal5.dataset/Animal5.txt: -------------------------------------------------------------------------------- 1 | TIGER 2 | HORSE 3 | ZEBRA 4 | BISON 5 | CAMEL 6 | LLAMA 7 | MOUSE 8 | KOALA 9 | PANDA 10 | SLOTH 11 | OTTER 12 | SKUNK 13 | EAGLE 14 | SNAKE 15 | WHALE 16 | SHARK 17 | SNAIL 18 | SQUID -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Animal5.dataset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : [ 3 | { 4 | "filename" : "Animal5.txt", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Animal6.dataset/Animal6.txt: -------------------------------------------------------------------------------- 1 | POODLE 2 | MONKEY 3 | RABBIT 4 | BEAVER 5 | BADGER 6 | TURKEY 7 | PARROT 8 | TURTLE 9 | LIZARD 10 | DRAGON 11 | BEETLE 12 | SPIDER 13 | SHRIMP -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Animal6.dataset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : [ 3 | { 4 | "filename" : "Animal6.txt", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Animal7.dataset/Animal7.txt: -------------------------------------------------------------------------------- 1 | GORILLA 2 | RACCOON 3 | LEOPARD 4 | UNICORN 5 | GIRAFFE 6 | MAMMOTH 7 | HAMSTER 8 | CHICKEN 9 | ROOSTER 10 | PENGUIN 11 | PEACOCK 12 | DOLPHIN 13 | OCTOPUS 14 | CRICKET 15 | LOBSTER -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Animal7.dataset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : [ 3 | { 4 | "filename" : "Animal7.txt", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/120-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/120-1.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/152.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/167.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/20.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/40-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/40-1.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/40-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/40-2.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/58-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/58-1.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/58.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/80-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/80-1.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/80.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5j54d93/Wordle-Like-iOS-Game/0363e50c94dcaaf06abebabc29b7b7d4f87ef99a/Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/87.png -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "40.png", 5 | "idiom" : "iphone", 6 | "scale" : "2x", 7 | "size" : "20x20" 8 | }, 9 | { 10 | "filename" : "60.png", 11 | "idiom" : "iphone", 12 | "scale" : "3x", 13 | "size" : "20x20" 14 | }, 15 | { 16 | "filename" : "58.png", 17 | "idiom" : "iphone", 18 | "scale" : "2x", 19 | "size" : "29x29" 20 | }, 21 | { 22 | "filename" : "87.png", 23 | "idiom" : "iphone", 24 | "scale" : "3x", 25 | "size" : "29x29" 26 | }, 27 | { 28 | "filename" : "80.png", 29 | "idiom" : "iphone", 30 | "scale" : "2x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "filename" : "120.png", 35 | "idiom" : "iphone", 36 | "scale" : "3x", 37 | "size" : "40x40" 38 | }, 39 | { 40 | "filename" : "120-1.png", 41 | "idiom" : "iphone", 42 | "scale" : "2x", 43 | "size" : "60x60" 44 | }, 45 | { 46 | "filename" : "180.png", 47 | "idiom" : "iphone", 48 | "scale" : "3x", 49 | "size" : "60x60" 50 | }, 51 | { 52 | "filename" : "20.png", 53 | "idiom" : "ipad", 54 | "scale" : "1x", 55 | "size" : "20x20" 56 | }, 57 | { 58 | "filename" : "40-1.png", 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "20x20" 62 | }, 63 | { 64 | "filename" : "29.png", 65 | "idiom" : "ipad", 66 | "scale" : "1x", 67 | "size" : "29x29" 68 | }, 69 | { 70 | "filename" : "58-1.png", 71 | "idiom" : "ipad", 72 | "scale" : "2x", 73 | "size" : "29x29" 74 | }, 75 | { 76 | "filename" : "40-2.png", 77 | "idiom" : "ipad", 78 | "scale" : "1x", 79 | "size" : "40x40" 80 | }, 81 | { 82 | "filename" : "80-1.png", 83 | "idiom" : "ipad", 84 | "scale" : "2x", 85 | "size" : "40x40" 86 | }, 87 | { 88 | "filename" : "76.png", 89 | "idiom" : "ipad", 90 | "scale" : "1x", 91 | "size" : "76x76" 92 | }, 93 | { 94 | "filename" : "152.png", 95 | "idiom" : "ipad", 96 | "scale" : "2x", 97 | "size" : "76x76" 98 | }, 99 | { 100 | "filename" : "167.png", 101 | "idiom" : "ipad", 102 | "scale" : "2x", 103 | "size" : "83.5x83.5" 104 | }, 105 | { 106 | "filename" : "1024.png", 107 | "idiom" : "ios-marketing", 108 | "scale" : "1x", 109 | "size" : "1024x1024" 110 | } 111 | ], 112 | "info" : { 113 | "author" : "xcode", 114 | "version" : 1 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Fruit&Food5.dataset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : [ 3 | { 4 | "filename" : "Fruit&Food5.txt", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Fruit&Food5.dataset/Fruit&Food5.txt: -------------------------------------------------------------------------------- 1 | GRAPE 2 | MELON 3 | LEMON 4 | MANGO 5 | APPLE 6 | PEACH 7 | OLIVE 8 | ONION 9 | BREAD 10 | BAGEL 11 | BACON 12 | PIZZA 13 | SUSHI 14 | DANGO 15 | CANDY -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Fruit&Food6.dataset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : [ 3 | { 4 | "filename" : "Fruit&Food6.txt", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Fruit&Food6.dataset/Fruit&Food6.txt: -------------------------------------------------------------------------------- 1 | OYSTER 2 | COOKIE 3 | TAMALE 4 | POTATO 5 | TOMATO 6 | BANANA 7 | CHERRY 8 | CARROT 9 | GARLIC 10 | PEANUT 11 | WAFFLE 12 | CHEESE 13 | BUTTER -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Fruit&Food7.dataset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : [ 3 | { 4 | "filename" : "Fruit&Food7.txt", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Assets.xcassets/Fruit&Food7.dataset/Fruit&Food7.txt: -------------------------------------------------------------------------------- 1 | PANCAKE 2 | COCONUT 3 | AVOCADO 4 | PRETZEL 5 | BURRITO 6 | FALAFEL 7 | POPCORN 8 | CUPCAKE 9 | CUSTARD -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/ColorExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorExtension.swift 3 | // Wordle-Like-iOS-Game 4 | // 5 | // Created by 莊智凱 on 2022/3/30. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | 11 | extension Color: RawRepresentable { 12 | 13 | public init?(rawValue: String) { 14 | guard let data = Data(base64Encoded: rawValue) else { 15 | self = .black 16 | return 17 | } 18 | 19 | do { 20 | let color = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as? UIColor ?? .black 21 | self = Color(color) 22 | } catch { 23 | self = .black 24 | } 25 | } 26 | 27 | public var rawValue: String { 28 | do { 29 | let data = try NSKeyedArchiver.archivedData(withRootObject: UIColor(self), requiringSecureCoding: false) as Data 30 | return data.base64EncodedString() 31 | } catch { 32 | return "" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Wordle-Like-iOS-Game 4 | // 5 | // Created by 莊智凱 on 2022/3/29. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | 12 | @AppStorage("letters") var letters = 5 13 | 14 | @State private var wordle = Wordle() 15 | @State private var timer: Timer? 16 | 17 | var body: some View { 18 | GeometryReader { geometry in 19 | VStack { 20 | TitleView(wordle: $wordle) 21 | GameTypeView(wordle: $wordle) 22 | Spacer() 23 | GameGridsView(wordle: $wordle, geometry: geometry) 24 | Spacer() 25 | KeyBoardView(wordle: $wordle, timer: $timer) 26 | } 27 | .padding(.horizontal) 28 | .padding(.bottom) 29 | .onAppear { 30 | if (wordle.grids[0] == Grid(value: " ", type: Grid.gridType.blank)) { 31 | wordle.gameStart() 32 | } 33 | } 34 | } 35 | } 36 | } 37 | 38 | struct ContentView_Previews: PreviewProvider { 39 | static var previews: some View { 40 | ContentView() 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/GameGridsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameGridsView.swift 3 | // Wordle-Like-iOS-Game 4 | // 5 | // Created by 莊智凱 on 2022/3/30. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct GameGridsView: View { 11 | 12 | @AppStorage("correctColor") var correctColor = Color(red: 108/255, green: 170/255, blue: 100/255) 13 | @AppStorage("wrongSpotColor") var wrongSpotColor = Color(red: 200/255, green: 180/255, blue: 88/255) 14 | @AppStorage("notInAnswerColor") var notInAnswerColor = Color.gray 15 | @AppStorage("letters") var letters = 5 16 | 17 | @State private var degree : Double = 0 18 | 19 | @Binding var wordle : Wordle 20 | 21 | var geometry : GeometryProxy 22 | 23 | var body: some View { 24 | LazyVGrid(columns: Array(repeating: GridItem(), count: letters)) { 25 | ForEach(0..) -> SFSafariViewController { 17 | return SFSafariViewController(url: url) 18 | } 19 | 20 | func updateUIViewController(_ safariViewController: SFSafariViewController, context: UIViewControllerRepresentableContext) { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/SettingsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsView.swift 3 | // Wordle-Like-iOS-Game 4 | // 5 | // Created by 莊智凱 on 2022/3/30. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SettingsView: View { 11 | 12 | @AppStorage("correctColor") var correctColor = Color(red: 108/255, green: 170/255, blue: 100/255) 13 | @AppStorage("wrongSpotColor") var wrongSpotColor = Color(red: 200/255, green: 180/255, blue: 88/255) 14 | @AppStorage("notInAnswerColor") var notInAnswerColor = Color.gray 15 | @AppStorage("topic") var topic = "Animal" 16 | @AppStorage("letters") var letters = 5 17 | 18 | @State private var showSafari = false 19 | 20 | @Binding var wordle : Wordle 21 | @Binding var showSettings : Bool 22 | 23 | var topics = ["Animal", "Fruit&Food"] 24 | 25 | var body: some View { 26 | NavigationView { 27 | VStack { 28 | List { 29 | Section(header: Text("Game Type")) { 30 | Picker(selection: $letters) { 31 | ForEach(5...7, id: \.self) { num in 32 | Text(String(num)) 33 | } 34 | } label: { 35 | Text("Letters") 36 | } 37 | .onChange(of: letters) { _ in 38 | wordle.gameStart() 39 | } 40 | Picker(selection: $topic) { 41 | ForEach(topics, id: \.self) { topic in 42 | Text(topic) 43 | } 44 | } label: { 45 | Text("Topic") 46 | } 47 | .onChange(of: topic) { _ in 48 | wordle.gameStart() 49 | } 50 | } 51 | 52 | Section(header: Text("Color")) { 53 | ColorPicker("Correct Color", selection: $correctColor) 54 | ColorPicker("Wrong Spot Color", selection: $wrongSpotColor) 55 | ColorPicker("Not In Answer Color", selection: $notInAnswerColor) 56 | } 57 | 58 | Section(header: Text("Community")) { 59 | Button { 60 | showSafari = true 61 | } label: { 62 | HStack { 63 | Text("Twitter") 64 | Spacer() 65 | AsyncImage(url: URL(string: "https://play-lh.googleusercontent.com/6YKvTYU0qunPIsv7BvlQTrIKqbczaG75-POrOlVRdXdHlWqj3grpRs-MkkK6GJrVqjs=s360")) { image in 66 | image 67 | .resizable() 68 | .scaledToFit() 69 | } placeholder: { 70 | Color.gray.overlay { ProgressView() } 71 | } 72 | .frame(width: 25, height: 25) 73 | .cornerRadius(5) 74 | } 75 | } 76 | } 77 | 78 | Section(header: Text("© 2022 Ricky Chuang")) { } 79 | } 80 | .listStyle(.grouped) 81 | } 82 | .navigationBarTitleDisplayMode(.inline) 83 | .toolbar { 84 | ToolbarItem(placement: .navigationBarLeading) { 85 | Button { 86 | showSettings = false 87 | } label: { 88 | Text(Image(systemName: "chevron.backward")) 89 | .font(.headline) 90 | Text("Back") 91 | .font(.title3) 92 | } 93 | } 94 | ToolbarItem(placement: .principal) { 95 | Text("Settings") 96 | .bold() 97 | .font(.title2) 98 | } 99 | } 100 | .fullScreenCover(isPresented: $showSafari) { 101 | SafariView(url: URL(string: "https://twitter.com/5j_54d93")!) 102 | } 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/TitleView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TitleView.swift 3 | // Wordle-Like-iOS-Game 4 | // 5 | // Created by 莊智凱 on 2022/3/29. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct TitleView: View { 11 | 12 | @State private var showHowToPlay = false 13 | @State private var showSettings = false 14 | @Binding var wordle : Wordle 15 | 16 | var body: some View { 17 | ZStack { 18 | Text("Wordle") 19 | .bold() 20 | .font(.largeTitle) 21 | .frame(maxWidth: .infinity) 22 | 23 | HStack(spacing: 5) { 24 | Button { 25 | showHowToPlay = true 26 | } label: { 27 | Text(Image(systemName: "questionmark.circle")) 28 | .bold() 29 | .foregroundColor(.black) 30 | } 31 | 32 | Spacer() 33 | 34 | Button { 35 | wordle.showResult = true 36 | } label: { 37 | Text(Image(systemName: "chart.bar")) 38 | .bold() 39 | .foregroundColor(.black) 40 | } 41 | 42 | Button { 43 | showSettings = true 44 | } label: { 45 | Text(Image(systemName: "gearshape.fill")) 46 | .bold() 47 | .foregroundColor(.black) 48 | } 49 | } 50 | .font(.title) 51 | } 52 | .sheet(isPresented: $showHowToPlay) { 53 | HowToPlayView() 54 | } 55 | .sheet(isPresented: $wordle.showResult) { 56 | ResultView(wordle: $wordle) 57 | } 58 | .fullScreenCover(isPresented: $showSettings) { 59 | SettingsView(wordle: $wordle, showSettings: $showSettings) 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Wordle-Like-iOS-Game/Wordle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Wordle.swift 3 | // Wordle-Like-iOS-Game 4 | // 5 | // Created by 莊智凱 on 2022/3/30. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | 11 | struct Grid: Equatable { 12 | enum gridType { case blank, typing, correct, wrongSpot, notInAnswer } 13 | 14 | var value : Character 15 | var type : gridType 16 | } 17 | 18 | struct Wordle { 19 | enum game { case playing, win, lose } 20 | 21 | @AppStorage("played") var played = 0 22 | @AppStorage("winTime") var winTime = 0 23 | @AppStorage("lastWin") var lastWin = false 24 | @AppStorage("currentStreak") var currentStreak = 0 25 | @AppStorage("maxStreak") var maxStreak = 0 26 | @AppStorage("topic") var topic = "Animal" 27 | @AppStorage("letters") var letters = 5 28 | 29 | var grids = Array(repeating: Grid(value: " ", type: Grid.gridType.blank), count: 30) 30 | var index = 0 31 | var answer = "" 32 | var showAlert = false 33 | var showResult = false 34 | var win = game.playing 35 | var time = 300 36 | 37 | var keyBoardFirstRow = [Grid(value: "Q", type: Grid.gridType.blank), Grid(value: "W", type: Grid.gridType.blank), Grid(value: "E", type: Grid.gridType.blank), Grid(value: "R", type: Grid.gridType.blank), Grid(value: "T", type: Grid.gridType.blank), Grid(value: "Y", type: Grid.gridType.blank), Grid(value: "U", type: Grid.gridType.blank), Grid(value: "I", type: Grid.gridType.blank), Grid(value: "O", type: Grid.gridType.blank), Grid(value: "P", type: Grid.gridType.blank)] 38 | var keyBoardSecondRow = [Grid(value: "A", type: Grid.gridType.blank), Grid(value: "S", type: Grid.gridType.blank), Grid(value: "D", type: Grid.gridType.blank), Grid(value: "F", type: Grid.gridType.blank), Grid(value: "G", type: Grid.gridType.blank), Grid(value: "H", type: Grid.gridType.blank), Grid(value: "J", type: Grid.gridType.blank), Grid(value: "K", type: Grid.gridType.blank), Grid(value: "L", type: Grid.gridType.blank)] 39 | var keyBoardThirdRow = [Grid(value: "Z", type: Grid.gridType.blank), Grid(value: "X", type: Grid.gridType.blank), Grid(value: "C", type: Grid.gridType.blank), Grid(value: "V", type: Grid.gridType.blank), Grid(value: "B", type: Grid.gridType.blank), Grid(value: "N", type: Grid.gridType.blank), Grid(value: "M", type: Grid.gridType.blank)] 40 | 41 | mutating func gameStart() { 42 | keyBoardFirstRow = [Grid(value: "Q", type: Grid.gridType.blank), Grid(value: "W", type: Grid.gridType.blank), Grid(value: "E", type: Grid.gridType.blank), Grid(value: "R", type: Grid.gridType.blank), Grid(value: "T", type: Grid.gridType.blank), Grid(value: "Y", type: Grid.gridType.blank), Grid(value: "U", type: Grid.gridType.blank), Grid(value: "I", type: Grid.gridType.blank), Grid(value: "O", type: Grid.gridType.blank), Grid(value: "P", type: Grid.gridType.blank)] 43 | keyBoardSecondRow = [Grid(value: "A", type: Grid.gridType.blank), Grid(value: "S", type: Grid.gridType.blank), Grid(value: "D", type: Grid.gridType.blank), Grid(value: "F", type: Grid.gridType.blank), Grid(value: "G", type: Grid.gridType.blank), Grid(value: "H", type: Grid.gridType.blank), Grid(value: "J", type: Grid.gridType.blank), Grid(value: "K", type: Grid.gridType.blank), Grid(value: "L", type: Grid.gridType.blank)] 44 | keyBoardThirdRow = [Grid(value: "Z", type: Grid.gridType.blank), Grid(value: "X", type: Grid.gridType.blank), Grid(value: "C", type: Grid.gridType.blank), Grid(value: "V", type: Grid.gridType.blank), Grid(value: "B", type: Grid.gridType.blank), Grid(value: "N", type: Grid.gridType.blank), Grid(value: "M", type: Grid.gridType.blank)] 45 | grids = Array(repeating: Grid(value: " ", type: Grid.gridType.blank), count: letters * 6) 46 | index = 0 47 | win = .playing 48 | time = 300 49 | if let asset = NSDataAsset(name: "\(topic)\(letters)"), 50 | let content = String(data: asset.data, encoding: .utf8) { 51 | let words = content.split(separator: "\n").map({ substring in 52 | return String(substring) 53 | }) 54 | answer = words.randomElement()! 55 | } 56 | } 57 | 58 | mutating func typing(key: Character) { 59 | if ( 60 | index < letters * 6 61 | && 62 | win == .playing 63 | && 64 | (index == 0 65 | || index % letters != 0 66 | || index % letters == 0 && grids[index-1].type != .typing) 67 | ) { 68 | grids[index].value = key 69 | grids[index].type = .typing 70 | index += 1 71 | } 72 | } 73 | 74 | mutating func delete() { 75 | if (index != 0 && grids[index-1].type == .typing) { 76 | grids[index-1].value = " " 77 | grids[index-1].type = .blank 78 | index -= 1 79 | } 80 | } 81 | 82 | mutating func checkAnswer() { 83 | if (index != 0 && index % letters == 0) { 84 | var word = "" 85 | for i in 0.. maxStreak) { 124 | maxStreak = currentStreak 125 | } 126 | lastWin = true 127 | } else { 128 | for i in 0..