An open API service indexing awesome lists of open source software.

https://github.com/khushi130404/sudoku

Sudoku is an interactive puzzle game built in Android Studio using Java, featuring backtracking and fragments for a seamless user experience. It efficiently manages the 9x9 grid using a 4D array structure (3x3x3x3).
https://github.com/khushi130404/sudoku

android-studio backtracking fragments java multithreading

Last synced: 6 months ago
JSON representation

Sudoku is an interactive puzzle game built in Android Studio using Java, featuring backtracking and fragments for a seamless user experience. It efficiently manages the 9x9 grid using a 4D array structure (3x3x3x3).

Awesome Lists containing this project

README

          

# Sudoku

Sudoku is an interactive puzzle game built in Android Studio using Java. This app leverages backtracking to solve Sudoku puzzles and provides a seamless user experience through the use of Android fragments. The Sudoku grid is managed using an efficient 4D array structure to represent the entire 9x9 grid as 3x3 sub-grids as 3x3x3x3.

## Main Sections

- New Game: Start a fresh Sudoku puzzle.

- Continue Game: Resume your previous game where you left off.

- Backtracking Visualization: Visualize the solving process using multithreading for a smooth experience.

- Victory Page: Celebrate your success with a dedicated victory screen upon completing the puzzle.

## Additional Features
- Time Counter: Tracks the duration of the game.
- Hint System: Provides hints to help solve the puzzle.
- Remaining Digits Tracker: Shows how many numbers are left to complete the grid.
- Score Calculation: Keeps track of your performance based on time and accuracy.
- Penalty System: Adds penalties for incorrect moves.
- Difficulty Levels: Choose from Easy, Medium, or Hard levels to suit your skill.

## Technical Details

- Language: Java

- IDE: Android Studio

- Algorithm: Backtracking algorithm for solving Sudoku puzzles.

- UI: Utilizes fragments to create a dynamic and modular interface.

- Data Structure: Uses a 4D array (3x3x3x3) to efficiently manage the entire Sudoku grid.

## How It Works

### Backtracking Algorithm

The core of the Sudoku solver is a backtracking algorithm. It systematically searches for the correct numbers to place in each cell, ensuring that the Sudoku rules are followed:
- Each row must have numbers 1 to 9 without repetition.
- Each column must have numbers 1 to 9 without repetition.
- Each 3x3 sub-grid must have numbers 1 to 9 without repetition.

### Multithreading for Visualization

The app uses multithreading to display the backtracking process in real time. This feature provides users with a visual representation of how the algorithm solves the puzzle step-by-step.

## Usage
1. Launch the App: Open the Sudoku app on your Android device.

2. Select a Mode: Choose between New Game or Continue Game.

3. Set Difficulty: Pick your desired difficulty level.

4. Start Playing: Use hints, track your time, and aim for the highest score!

5. Celebrate Victory: Upon completing the puzzle, enjoy the victory page to mark your achievement.