Simple implementation of a sudoku game made of a single screen displaying a editable sudoku board. The board is generated randomly. A new board can be generated by clicking new game.
Used a Clean architecture approach with MVVM. I didn't use modules in the interests of time, but the package structure could be extracted into a modular structure quite simply.
View -> ViewModels -> Domain (entities, platform interfaces, usecases) -> Repositories -> Services
Sudoku generation
Used some old java code from here https://github.com/a11n/sudoku
Libraries
Dagger, Navigation, Flexbox
Dagger setup
Uses both an application scope and an activity scope. The activity scope allows some funky things like the announcer in the view model
(wouldn't be possible with androidx ViewModel due to differing lifecycles)
Kotlin multiplatform
With a little bit of editing (e.g. resource provider) everything from (ViewModels -> Repositories) could be shared.
Entry validation Immediatley fail game if a wrong number is entered
Highlight selected cell on board also unhighlight if another cell is clicked
Add dividers between 3x3 cell blocks
Improve design use some outlined button backgrounds (unfilled) and add curved corners to the sudoku board.
Testing would use mockk/kluent. The project is already set up with DI and a test replacable dispatcher provider (so no funky coroutine
magic in tests) - so relitively simple to do from here.
Save board between sessions stick it in a database, need to research best way to do this for 2d array
Adaptive difficulty Store a value of square blank at the start. If fail a board, put difficulty down. If succeed a board put difficulty
up.
Erase current board Add a button to restart the current board
Add ability to use notes probably would use some sort of bottom sheet