STmihan / ctimer

ASCII art timer in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CTimer

CTimer is a simple terminal-based timer application written in C. It can either display the current time or count down from a specified number of seconds. The time is displayed in a stylized format using ASCII art.

Demo

Usage

To compile the project, you can use the provided Makefile. Simply run:

make

This will produce an executable named ctimer.

Running the Timer

To display the current time:

./ctimer

To start a countdown timer from a specified number of seconds:

./ctimer <time>

For example, to start a countdown timer from 60 seconds:

./ctimer 60

Command-line Arguments

  • <time>: The number of seconds to count down from. If not provided, the current time will be displayed.

Examples

Display the current time:

./ctimer

Start a countdown timer from 30 seconds:

./ctimer 30

Customization

The appearance of the timer can be customized by modifying the symbols and colors used for the foreground and background. These can be set in the style.h file.

style.h

#define RESET "\033[0m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define YELLOW "\033[33m"
#define BLUE "\033[34m"
#define MAGENTA "\033[35m"
#define CYAN "\033[36m"
#define WHITE "\033[37m"

#define BG_SYM " "
#define BG_COLOR WHITE
#define FG_SYM "█"
#define FG_COLOR WHITE

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

ASCII art timer in C

License:MIT License


Languages

Language:C 95.9%Language:Makefile 4.1%