Android-Wordle kt: Wordle game clone made with Kotlin & Compose

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

  • Replace Key event by text field
    Replace Key event by text field

    Jan 15, 2022

    Either find a way to make the active row a full text field properly displaying characters or define it as focusable/focused but invisible /hidden.

    At each input pushing word to view model would automatically update grid.

    This would allow writing accented characters (out any diacritic) for french, Spanish, ...

    enhancement compose 
    Reply
  • Let user choose language and word size
    Let user choose language and word size

    Jan 15, 2022

    • [ ] Smart user default (device locale + 5 letters).
    • [ ] persistence
    • [x] initial choice at first launch
    • [ ] option on settings
    • [ ] add source dictionary buckets in records to avoid melding results for different setup
    enhancement compose 
    Reply
  • Android should either rely on Android clipboard or Share Intent
    Android should either rely on Android clipboard or Share Intent

    Jan 17, 2022

    null

                                                                                                                                                                                                            compose android 
    Reply
  • All component state (visibility, data, …) should be fully driven by ViewModel
    All component state (visibility, data, …) should be fully driven by ViewModel

    Jan 17, 2022

    Currently, there is too much logic achieved at UI layer level.

    • [ ] toast dismiss period
    • [x] delay stats dialog appearance until all animated toasts are dismissed
    • [ ] delay restart button appearance until all animated toasts are dismissed
    • [x] determine if actions should be enabled
    enhancement compose 
    Reply
  • Backspace & Enter buttons enable state should also depend on current grid state
    Backspace & Enter buttons enable state should also depend on current grid state

    Jan 17, 2022

    • [ ] 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 
    Reply
  • Move replay button in stats dialog
    Move replay button in stats dialog

    Jan 18, 2022

    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 
    Reply
  • Review victory sequence
    Review victory sequence

    Jan 16, 2022

    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 
    Reply
  • Copy to clipboard should take dark mode into account
    Copy to clipboard should take dark mode into account

    Jan 17, 2022

    Black vs white square is expected.

    compose 
    Reply
  • Add invalid user input feedback in Compose
    Add invalid user input feedback in Compose

    Jan 9, 2022

    • [x] word too short toast
    • [x] word not in user dictionary toast
    • [x] ~animation (see #2)~
    compose 
    Reply
  • Lost game can also lead to share state
    Lost game can also lead to share state

    Jan 17, 2022

    Wordle 212 X/6
    
    ? ? ⬜ ⬜ ⬜
    ? ? ⬜ ⬜ ⬜
    ? ? ⬜ ⬜ ⬜
    ? ? ⬜ ⬜ ⬜
    ? ? ⬜ ⬜ ⬜
    ? ? ⬜ ⬜ ⬜ 
    
    bug compose 
    Reply
  • Add toast when winning the game in Compose version
    Add toast when winning the game in Compose version

    Jan 9, 2022

    null

                                                                                                                                                                                                            compose 
    Reply
  • Implement the share button when finishing the game
    Implement the share button when finishing the game

    Jan 11, 2022

    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 
    Reply