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

https://github.com/msio808/quizbit

My CS50x final project | CLI based quiz game written in C
https://github.com/msio808/quizbit

c cs50 cs50x openssl quiz quizgame regex sha-256 sqlite sqlite3

Last synced: 6 months ago
JSON representation

My CS50x final project | CLI based quiz game written in C

Awesome Lists containing this project

README

          




project-cover

QUIZBIT - QUIZ GAME


► CLI based quiz game written in C

Softwares/Technologies Used


CLION ┃ SQLite3 ┃ OpenSSL ┃ CMake ┃ Makefile ┃ valgrind



🔗 Table Of Contents




📍 Overview




    This project is a CLI Quiz Game written in C as my final project for the CS50x course.
    It is designed to test user's knowledge across three categories: Science, Sports, and General Knowledge.
    Users can log in to an existing account or sign up for a new one, and their progress is saved in an SQLite database.
    This project demonstrates proficiency in C programming, database management, and basic security practices.





📦 Features


    User Authentication


      Users can log in to their account or create a new one through the sign-up process

    Quiz Categories


      The game offers three categories — Science, Sports, and General Knowledge. Users can choose any category to start the quiz.

    Randomized Questions


      Questions are randomly selected from the chosen category to ensure a unique experience each time.

    Score Tracking


      The game records user scores and allows users to view their scores in their profile.

    Profile Management

      Users can view their profile, edit their information, delete their account, or reset their profile data.


📂 Repository Structure

```
.
├── config
│ ├── build.sh
│ ├── CMakeLists.txt
│ ├── install_requirements.sh
│ └── requirements.txt
├── docs
│ ├── img
│ │ └── qmark.png
│ └── README.md
├── include
│ ├── console.h
│ ├── db.h
│ ├── emojis.h
│ ├── gamecore.h
│ ├── gamemath.h
│ ├── global.h
│ └── utilities.h
├── LICENSE
└── src
├── console
│ └── terminal.c
├── core
│ ├── account.c
│ ├── gamecore.c
│ ├── gamemath.c
│ ├── gameplay.c
│ └── userprofile.c
├── db
│ ├── database.c
│ └── questions.c
├── main.c
└── utils
├── authutil.c
├── gameutil.c
└── utilities.c

```


🚀 Getting Started


Requirements



► gcc make cmake sqlite3 valgrind libssl-dev libpcre3-dev

⚙️ Installation

### Clone the quizbit repository:

```sh
git clone https://github.com/msio808/quizbit.git
```

### Change to the project directory:

```sh
cd quizbit/config/
```

### Install the dependencies:

```sh
./install_requirements.sh
```

### 🤖 Running the project

```sh
./build.sh --run
```

### 🧪 Debugging
```sh
./build.sh --memcheck
```
### 🗑 Clean generated build files
```sh
./build.sh --clean OR ./build.sh --clean-all
```


Usage

- After building and running the project, Choose "Sign Up" and follow the prompts to create an account.
- Login to your account.
- Use the arrow keys to navigate through the game
- Click on the ```gameplay help``` menu to read more about the game.
- Select a quiz category.
- Answer the quiz questions and track your score.

## 🚀 Screenshot

![Watch the demo](https://raw.githubusercontent.com/msio808/quizbit/main/docs/img/screenshot.png)

## 🛠️ Improvements
- Some of the functions in the ```src/core/gamemath.c``` needs improvements

- The ```SIGWINCH``` functions located in the ```src/console/terminal.c``` also needs improvements.

🤝 Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines

1. Fork the Repository to your GitHub account.
2. Clone the forked repository to your PC.
```sh
git clone https://github.com/msio808/quizbit.git
```
3. Create a new branch & give it a descriptive name.
```sh
git checkout -b new-feature-x
```
4. Make and test your changes locally.
5. Commit with a clear message describing your updates.
```sh
git commit -m 'Implemented new feature x.'
```
6. Push the changes to your forked repository.
```sh
git push origin new-feature-x
```
7. Submit a pull request.


Check Out this 🔗 Documentation for more.



📄 License



This project is distributed under the GPL-3.0 LICENSE



👏 Acknowledgments

- 🔗 [_`COMPART`_](https://www.compart.com/en/unicode/)

- 🔗 [_`OpenSSL`_](https://www.openssl.org/docs/manmaster/man3/EVP_MD_CTX_new.html/)

- 🔗 [_`Pull Request`_](https://daily.dev/blog/how-to-contribute-to-open-source-github-repositories)

- 🔗 [_`Doxygen Uses`_](https://fnch.users.sourceforge.net/doxygen_c.html)

- 🔗 [_`getch() for Unix`_](https://ascheng.medium.com/linux-getch-for-unix-c2c829721a30/)

- 🔗 [_`termios(3) - Linux man page`_](https://linux.die.net/man/3/termios)

- 🔗 [_`nanosleep(2) — Linux manual page`_](https://man7.org/linux/man-pages/man2/nanosleep.2.html)
- 🔗 [_`ANSI Color Codes`_](https://talyian.github.io/ansicolors/)

quick links