Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typing-in-c

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.


Features

  • 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

Dependencies

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.


Building

Compile using GCC:

gcc main.c dynamic_arrays.c -o typing

Run:

./typing

Usage

After launching the program:

  1. Enter an approximate typing speed in WPM
  2. Type the desired text
  3. Press Ctrl+D to finish input
  4. 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.


Implementation Details

The program uses:

  • usleep() for typing delay simulation
  • write() 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))

Future Improvements

  • Real WPM calculation
  • Colored terminal output
  • Better input handling
  • Multiple typing modes
  • ncurses-based UI
  • File input support
  • Random typing prompts

About

Typewriter Effect in C

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages