Skip to content

thisIsHarshB/cdoku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

C-Doku: A Terminal-Based Sudoku Game

๐Ÿ“Œ Introduction

C-Doku is a command-line Sudoku game written in C, featuring an interactive grid, difficulty levels, a leaderboard, and an SQLite-based scoring system. Players can solve randomly generated Sudoku puzzles while tracking their scores based on time, accuracy, and difficulty.

๐ŸŽฎ Features

  • Random Sudoku Generation ๐Ÿงฉ
  • Three Difficulty Levels (Easy, Medium, Hard)
  • Scoring System based on correct moves, penalties, and time bonus
  • SQLite Database Integration for user authentication and leaderboard
  • User-Friendly Controls with arrow keys for navigation

๐Ÿ›  Installation & Compilation

Prerequisites

Ensure you have the following installed:

  • GCC Compiler (gcc)
  • SQLite3 Library (sqlite3)

Compiling the Game

Run the following command in the terminal:

gcc -o cdoku sudoku.c -lsqlite3

๐Ÿƒ Running the Game

After compiling, execute:

./cdoku

๐Ÿ•น Controls

  • Arrow Keys โ†’ Navigate the Sudoku grid
  • 1-9 Keys โ†’ Fill a cell with a number
  • Q Key โ†’ Quit the game

๐Ÿ“Š Scoring System

Action Points
Correct entry +10
Incorrect entry -5
Time bonus (300 / time_taken) * 5
Difficulty multiplier x1 (Easy), x2 (Medium), x3 (Hard)

๐Ÿ“œ Database Schema

C-Doku uses SQLite3 for user authentication and score tracking:

  • Users Table: Stores usernames and passwords
  • Leaderboard Table: Stores usernames and their highest scores

๐Ÿš€ Future Enhancements

  • Add hint system for players as in the actual mobile games.
  • Implement Graphical UI version to make it visually appealing.
  • Enable multiplayer mode to make it more interesting.
  • Make it platform-independent so that it should work on Linux/MacOS, etc.
  • Maintain a database with pre-generated puzzles to randomly fetch them instead of generating it each time.

๐Ÿ‘จโ€๐Ÿ’ป Contributing

Feel free to fork this repository, create pull requests, and report issues. Contributions are always welcome!


About

C-Doku is a command-line Sudoku game written in C, featuring an interactive grid, difficulty levels, a leaderboard, and an SQLite-based scoring system. Players can solve randomly generated Sudoku puzzles while tracking their scores based on time, accuracy, and difficulty.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages