{"id":25832765,"url":"https://github.com/ompreetham/wordscramble","last_synced_at":"2026-05-17T11:34:43.570Z","repository":{"id":240578282,"uuid":"803007020","full_name":"OmPreetham/WordScramble","owner":"OmPreetham","description":"WordScramble is a SwiftUI-based word game where players create new words from a given root word. Designed for 100DaysOfSwiftUI","archived":false,"fork":false,"pushed_at":"2024-06-26T04:28:03.000Z","size":334,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-16T09:10:55.177Z","etag":null,"topics":["100daysofswiftui","apple","apple-app","apple-ios","game","ios","ios17","ios18","players","swift","swiftui","wordgame","wordguessing","words","wordscramble"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OmPreetham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-19T21:07:22.000Z","updated_at":"2024-06-26T04:28:06.000Z","dependencies_parsed_at":"2024-05-19T22:25:15.456Z","dependency_job_id":"12eaf5ac-864a-4a79-b429-7a139105c3bd","html_url":"https://github.com/OmPreetham/WordScramble","commit_stats":null,"previous_names":["ompreetham/wordscramble"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OmPreetham/WordScramble","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmPreetham%2FWordScramble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmPreetham%2FWordScramble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmPreetham%2FWordScramble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmPreetham%2FWordScramble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OmPreetham","download_url":"https://codeload.github.com/OmPreetham/WordScramble/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmPreetham%2FWordScramble/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33136837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["100daysofswiftui","apple","apple-app","apple-ios","game","ios","ios17","ios18","players","swift","swiftui","wordgame","wordguessing","words","wordscramble"],"created_at":"2025-02-28T21:48:45.725Z","updated_at":"2026-05-17T11:34:43.554Z","avatar_url":"https://github.com/OmPreetham.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordScramble\n\nWordScramble is a SwiftUI-based word game where players create new words from a given root word. The game enforces various rules to ensure the words are valid and calculates a score based on the length of the words.\n\n## Features\n\n- **Dynamic Word Input**: Users can enter new words via a text field.\n- **Word Validation**: The app checks if the entered word:\n  - Is not empty\n  - Has not been used before\n  - Is not the root word itself\n  - Is longer than three characters\n  - Can be constructed from the letters of the root word\n  - Is a real English word\n- **Score Calculation**: The score is updated based on the length of the valid words entered.\n- **New Game**: Users can start a new game, which will load a new root word and reset the score and used words.\n\n## Getting Started\n\nThese instructions will help you set up and run the project on your local machine for development and testing purposes.\n\n### Prerequisites\n\n- Xcode 12 or later\n- Swift 5.3 or later\n\n### Installation\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/OmPreetham/WordScramble.git\n    ```\n2. Open the project in Xcode:\n    ```bash\n    cd WordScramble\n    open WordScramble.xcodeproj\n    ```\n3. Run the project on the simulator or a physical device.\n\n## Code Overview\n\n### `ContentView.swift`\n\nThis is the main view of the app, where the game logic is implemented.\n\n- **State Variables**:\n  - `usedWords`: An array of words used by the player.\n  - `rootWord`: The current root word from which new words are derived.\n  - `newWord`: The word currently being entered by the player.\n  - `errorTitle` and `errorMessage`: For displaying error alerts.\n  - `showingError`: Boolean to control the display of error alerts.\n  - `score`: The player's current score.\n\n- **Main UI Components**:\n  - `NavigationStack`: The main container for the view.\n  - `TextField`: Allows the user to input new words.\n  - `List`: Displays the list of used words with their lengths.\n  - `Toolbar`: Contains the score display and a button to start a new game.\n  \n- **Game Functions**:\n  - `startGame()`: Loads a new root word and resets the game state.\n  - `addNewWord()`: Validates the new word and updates the game state.\n  - `isOriginal(word:)`: Checks if the word has been used before.\n  - `isRootWord(word:)`: Ensures the word is not the root word itself.\n  - `isShorter(word:)`: Checks if the word is at least four characters long.\n  - `isPossible(word:)`: Validates if the word can be made from the root word.\n  - `isReal(word:)`: Uses `UITextChecker` to ensure the word is valid.\n  - `calculateScore(for:)`: Updates the score based on the word length.\n  - `wordError(title:message:)`: Displays an error alert.\n\n## Screenshots\n\n![New](./screenshots/wordscramble.png)\n![Error](./screenshots/wordscramble-error.png)\n![Found](./screenshots/wordscramble-found.png)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- The app is inspired by the word game featured in the 100 Days of SwiftUI course by Paul Hudson.\n- Thanks to Apple for providing the development tools and frameworks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fompreetham%2Fwordscramble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fompreetham%2Fwordscramble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fompreetham%2Fwordscramble/lists"}