A simple terminal-based typing simulator written in C.
This project takes user input and replays it character-by-character at a configurable typing speed, creating the effect of simulated typing inside the terminal.
The project also demonstrates the usage of a custom dynamic array implementation written in C.
- Terminal-based typing simulation
- Configurable typing speed
- Character-by-character output
- Uses low-level system calls like
write() - Built using a custom dynamic array library
- Lightweight and minimal
This project depends on the custom dynamic array library from:
dynamic-c-array
Make sure dynamic_arrays.h and the corresponding implementation file are available during compilation.
Compile using GCC:
gcc main.c dynamic_arrays.c -o typingRun:
./typingAfter launching the program:
- Enter an approximate typing speed in WPM
- Type the desired text
- Press
Ctrl+Dto finish input - The program replays the text with simulated typing
Example:
Enter rough wpm speed: 80
Press Ctrl+D to end your typing!
Enter the string:
Hello world!
Output is then replayed character-by-character.
The program uses:
usleep()for typing delay simulationwrite()for low-level terminal output- Dynamic arrays for storing input strings
- Standard input stream processing using
scanf
The typing delay is controlled using:
#define pause(x) usleep(12000000 / (x))- Real WPM calculation
- Colored terminal output
- Better input handling
- Multiple typing modes
- ncurses-based UI
- File input support
- Random typing prompts