Wordle game clone written in Kotlin & using Compose UI Toolkit.

Overview

Build Status

Wordle Compose

Wordle game clone written in Kotlin & using Compose UI Toolkit.

Screenshots

Compose for Desktop

Main screens

Playing Victory End of game Settings How to play

Light & Dark mode

Light 🌞 Dark 🌛

ASCII/Console mode

.---------------.
| Hello Wordle! |
'---------------'
 ➡️ Enter a 5 letter english word: hello
Wordle 189 4/6
T⬛I⬛L🟩E🟨S⬛
G⬛R⬛E🟨A⬛T⬛
T⬛A⬛L🟩E🟨S⬛
H🟩E🟩L🟩L🟩O🟩
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
Congrats! You found the correct answer 🎉: HELLO
 🔄 Play again? (y/N) 
Full game…
.---------------.
| Hello Wordle! |
'---------------'
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜

 ➡️ Enter a 5 letter english word: tiles
T⬛I⬛L🟩E🟨S⬛
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
Keep going… 1/6
 ➡️ Enter a 5 letter english word: great
T⬛I⬛L🟩E🟨S⬛
G⬛R⬛E🟨A⬛T⬛
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
Keep going… 2/6
 ➡️ Enter a 5 letter english word: tales
T⬛I⬛L🟩E🟨S⬛
G⬛R⬛E🟨A⬛T⬛
T⬛A⬛L🟩E🟨S⬛
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
Keep going… 3/6
 ➡️ Enter a 5 letter english word: hello
Wordle 189 4/6
T⬛I⬛L🟩E🟨S⬛
G⬛R⬛E🟨A⬛T⬛
T⬛A⬛L🟩E🟨S⬛
H🟩E🟩L🟩L🟩O🟩
 ⬜ ⬜ ⬜ ⬜ ⬜
 ⬜ ⬜ ⬜ ⬜ ⬜
Congrats! You found the correct answer 🎉: HELLO
 🔄 Play again? (y/N) 

Tech Stack

Development

To build and run the desktop application, run the following command

./gradlew run

To run tests, run the following command

./gradlew test

To build and package desktop application, run the following command

./gradlew assembleDist

License

The MIT License (MIT)

Copyright (c) 2022 Olivier Patry

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Implement the share button when finishing the game

    Implement the share button when finishing the game

    This is a bit tedious to achieve given that it's dependent on underlying platform internals.

    • [x] Compose desktop should rely on AWT clipboard
    • [ ] #28
    • [x] Add toast message "Copied results to clipboard"
    • [x] For Mosaic version, we could automatically put to clipboard without user action, maybe we could rely on pbcopy call system?

    In this SO answer, it is suggested to use a CompositionLocalProvider to delegate the impl: https://stackoverflow.com/a/68389985/2551689

    enhancement compose mosaic android 
    opened by opatry 2
  • Move replay button in stats dialog

    Move replay button in stats dialog

    In official game, at the left of the Share button, there is a counter for the next word, we could use this place holder for our restart button and stay closed to original game design.

    compose 
    opened by opatry 1
  • Envisage reusing word list & choice with official Wordle

    Envisage reusing word list & choice with official Wordle

    Given https://github.com/hannahcode/wordle#wordle-clone it appears words list is available in front end in official game and that the today's word could be inferred with something like

    WORDS[Math.floor((NOW_IN_MS - GAME_EPOCH_IN_MS) / ONE_DAY_IN_MS)]
    
    opened by opatry 0
  • Screen abstraction/navigation might be needed to clean `WordleApp()` Composable

    Screen abstraction/navigation might be needed to clean `WordleApp()` Composable

    Currently, the transition from dictionary picker to loading to game screen is a bit ad hoc and might be improved thanks to a screen abstraction.

    Here is what was done for another POC game.

    sealed class Screen {
        object Home : Screen()
        data class Progress(val maxRank: Int) : Screen()
        data class Settings(val player: PlayerInfo) : Screen()
        data class Scores(val player: PlayerInfo) : Screen()
        object Inventory : Screen()
        data class InGame(val mode: GameRules.Mode) : Screen() {
            val rules = GameRules(mode)
        }
    
        data class Statistics(val player: PlayerInfo, val viewModel: GameRulesViewModel) : Screen()
    }
    
    @Composable
    fun HuesApp() {
        CheapHuesComposeTheme {
            var screenState by remember { mutableStateOf<Screen>(Screen.Home) }
            val player by remember { mutableStateOf(PlayerInfo.DEFAULT_PLAYER) }
    
            val backToHome = { screenState = Screen.Home }
    
            screenState.let { screen ->
                when (screen) {
                    Screen.Home -> HomeScreen(player) { screenState = it }
                    is Screen.Inventory -> InventoryScreen(player, backToHome)
                    is Screen.Settings -> SettingsScreen(player, backToHome)
                    is Screen.Scores -> ScoresScreen(player, backToHome)
                    is Screen.Progress -> ProgressionScreen(3, backToHome)
                    is Screen.InGame -> {
                        val viewModel = GameRulesViewModel(player, screen.rules)
                        val status = rememberUpdatedState(viewModel.status)
    
                        when (status.value) {
                            GameRules.GameStatus.PLAYING -> GameScreen(viewModel, backToHome)
                            else -> EndOfGameScreen(viewModel) {
                                screenState = Screen.Statistics(player, viewModel)
                            }
                        }
                    }
                    is Screen.Statistics -> StatisticsScreen(
                        screen.player,
                        screen.viewModel,
                        onRestart = {
                            screen.viewModel.restart()
                            screenState = Screen.InGame(screen.viewModel.mode)
                        },
                        onQuit = backToHome
                    )
                }
            }
        }
    }
    
    enhancement compose 
    opened by opatry 0
  • Review victory sequence

    Review victory sequence

    1. Grid animation
    2. Victory message toast
    3. Once toast is dismissed, show victory dialog
    4. Once victory dialog is dismissed, show restart and answer placeholder

    Will also fix

    • #4
    enhancement compose 
    opened by opatry 0
  • Use an enum for all available dialog type

    Use an enum for all available dialog type

    Instead of having as many booleans as dialogs types, given that only one of them can be displayed at once, define a (nullable or having a none case) visible dialog state.

    compose 
    opened by opatry 0
  • Stats graph + share should be displayed in toolbar stats dialog

    Stats graph + share should be displayed in toolbar stats dialog

    The stats dialog should be the same for end of game or toolbar menu. The criteria to display graph is only to determine if the last played game was a victory or not.

    bug compose 
    opened by opatry 0
  • Display stats and streaks in Compose version

    Display stats and streaks in Compose version

    Based on #6

    • [x] Compute last streak
    • [x] Compute stats
    • [x] Add stats dialog (charts button added at left of settings in official app recently) (done in 2cd276e)

    Capture d’écran 2022-01-11 à 09 10 28

    enhancement compose 
    opened by opatry 0
  • Allow fetching user defined dictionaries

    Allow fetching user defined dictionaries

    • [ ] Drop any words_[a-z]{2}_[\d]+.txt in app's data dir (esp. for Desktop)
    • [ ] Add a button to open a file picker in DictionaryPicker (would need CompositionLocalProvider for Desktop & Android)
    • [ ] Define a builtIn attribute in Dictionary
    • [ ] Add special indicator (user icon vs system icon?) in dictionary list
    • [ ] Handle invalid data
    enhancement compose 
    opened by opatry 0
  • Screen transition aren't smooth at all (especially visible on Android)

    Screen transition aren't smooth at all (especially visible on Android)

    When transitioning from dictionary picker to loading to game to "how to play", there are several freezes.

    • Should we do more work in background?
    • Should we optimize recomposition for some Composable?
    • ?
    bug compose 
    opened by opatry 0
  • Backspace & Enter buttons enable state should also depend on current grid state

    Backspace & Enter buttons enable state should also depend on current grid state

    • [ ] Backspace should only be enabled if at least 1 character is entered
    • [ ] Enter should only be enabled if entered answer matches requested word size
    enhancement compose 
    opened by opatry 0
Owner
Olivier Patry
Mobile team lead @MyScript.
Olivier Patry
Wordlesolver - Wordle (Gurgle) solver with code from Wordle-Solver

WordleSolver Wordle (Gurgle) solver with code from https://github.com/PoorLazyCo

Bill Farmer 9 Nov 27, 2022
WordleSolver - A small attempt to solve the Wordle game (in Spanish) without thinking too much

Wordle solver A small attempt to solve the Wordle game (in Spanish) without thin

Eduardo Pascua 2 Sep 30, 2022
The Destiny lore word game, that's definitely not just a worse version of Wordle!

Wormdle The Destiny lore word game, that's definitely not just a worse version of Wordle! Why not use an existing clone? Ever wanted to play Wordle, b

Ian Moore 2 Feb 6, 2022
This is an application that is about an X / O game. You can enter the names of the game, and there is also a screen for those who win and there is a button to continue playing and the game determines the result of each player

Game-X-O This is an application that is about an X / O game. You can enter the names of the game, and there is also a screen for those who win and the

Mohamed Rafat 2 Aug 20, 2022
WordleFX - Wordle in JavaFX and Kotlin

Wordle This simple game is everywhere right now (the beginning of 2022) and it s

Dave Barrett 13 Apr 14, 2022
SMBClone - SMD clone custom game engine. (Desktop + Android)

SMBClone Simple crossplatform game engine for like SMB game! Supported platforms

Victor Varenik 4 Jul 4, 2022
Our maze game is an 2d-animation game developed using android studio.

Our maze game is an 2d-animation game developed using android studio. The game consists of a ball and a board with a hole in the center of it. We are using accelerometer as controller to guide ball towards the hole. T

Suraj Devgan 6 Nov 29, 2022
A Tetris game written in Kotlin using JOGL.

A Fast Tetris Game Written in Kotlin Using JOGL. Note: This game is unfinished. Controls Arrow Key Left / Right -> Move the tetromino along the x-axis

Jordan 0 Dec 29, 2021
🐦 A flappy bird clone using Compose Web and radio button

?? Compose Bird A flappy bird clone using Compose Web and radio buttons

theapache64 36 Dec 31, 2022
Game made with Korge (Kotlin Multiplatform game engine)

MolesAttack Kotlin Multiplatform Game Play Html/js: https://feliperce.github.io/MolesAttack-Distribution/ Jar: https://feliperce.github.io/MolesAttack

Felipe Rodrigues 10 May 30, 2022
Extensive game framework written in Kotlin

CGS is a minigame framework I wrote in December of 2021. This project was closed-source, but unfortunately, a series of events led me to decide to open-source it.

Subham 9 Aug 22, 2022
A minimalist Android physics game written in Kotlin & libGDX

A minimalist Android physics game with 400.000+ downloads, written in Kotlin & libGDX

Luca1152 2 Dec 19, 2022
A simple Snake game implemented using Compose for Desktop

A simple Snake game implemented using Compose for Desktop

Arkadii Ivanov 58 Dec 27, 2022
Fifteen is a puzzle game created using Jetpack Compose for Android.

Fifteen / Jetpack Compose Fifteen is a puzzle game created using Jetpack Compose for Android. The goal of the game is to arrange the knuckles in ascen

Timur 2 Jan 17, 2022
🎮 A Minesweeper like puzzle game, built using Jetpack Compose, for Android.

Minesweeper w/ Jetpack Compose This is a Minesweeper-like puzzle game, built using Jetpack Compose, for Android. The objective of this game is to clea

Jaya Surya Thotapalli 64 Jan 2, 2023
A simple game that was developed using Kotlin

TruthOrDare About the App: A simple Android game that reminds you of your childhood . How to use? 1 - Clone or download the Project to your machine. 2

Leandro Santos 1 Jan 15, 2022
Basic template to create a game using minigdx

MiniGDX Game Template Create your first game using miniGDX by clicking the "Use this Template" button above. The game will be configured for: the JVM

MiniGDX 22 Dec 16, 2022
Tic Tac Toe game using Test Driven Development

Tic Tac Toe About this Kata This short and simple Kata should be performed using Test Driven Development (TDD). Rules The rules are described below :

null 0 Oct 11, 2021
A small game using Fleks Entity Component System.

Dinoleon TBD Credits Arks: Dino Sprites Szadi art: Platformer Fantasy Free Package craftpix.net: Jungle Cartoon GUI Soup of Justice Font cooltext.com

Simon 4 Oct 3, 2022