Skip to content

[app] Learn world capitals in the terminal.

License

Notifications You must be signed in to change notification settings

ryouze/ccapital

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ccapital

ccapital is a TUI quiz game designed for learning the capitals of the world (e.g., Berlin, Germany).

Motivation

I wanted to create a simple quiz game in C that uses ncurses for the TUI. The game is designed to help users learn the names of world capitals by displaying a random country name (e.g., "Germany") and prompting the user to identify its capital city (e.g., "Berlin"). But to be honest, it's more of an excuse to play around with good old C and ncurses.

Features

  • Written in modern C (C17).
  • Comprehensive documentation with doxygen-style comments.
  • Automatic third-party dependency management using CMake's FetchContent.

Project Structure

The src directory is organized as follows:

  • Single main.c file.

Tested Systems

This project has been tested on the following systems:

  • MacOS 14.5 (Sonoma)

Requirements

To build and run this project, you'll need:

  • C17 or higher
  • CMake

Build

Follow these steps to build the project:

  1. Clone the repository:

    git clone https://github.com/ryouze/ccapital.git
  2. Generate the build system:

    cd ccapital
    mkdir build && cd build
    cmake ..
  3. Compile the project:

    To compile the project, use the following command:

    make

    To use all available cores with make, pass the -j flag with the number of cores available on your system:

    # MacOS
    make -j$(sysctl -n hw.ncpu)
    # GNU/Linux
    make -j$(nproc)

After successful compilation, you can run the program using ./ccapital.

The mode is set to Release by default. To build in Debug mode, use cmake -DCMAKE_BUILD_TYPE=Debug ...

Install

If not already built, follow the steps in the Build section and ensure that you are in the build directory.

To install the program, use the following command:

sudo cmake --install .

Usage

To run the program, use the following command:

ccapital

Contributing

All contributions are welcome.

Credits

License

This project is released into the public domain and is licensed under the Unlicense.