Git Product home page Git Product logo

simplesudoku's Introduction

Sudoku

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.

Architecture

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.

Features to add

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.