Skip to content

VTom21/Typing-Speed-CLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Typing Test (CLI)

Skills

A terminal-based typing speed test application built with Rust that helps you improve your typing speed and accuracy.

Features

  • 60-second timed typing test with real-time progress tracking
  • Colorful terminal UI with visual feedback
  • Immediate word-by-word feedback - correct words in green, errors in red
  • Detailed statistics including:
    • Total words typed
    • Correct words count
    • Error count
    • Accuracy percentage
    • Raw WPM (Words Per Minute)
    • Adjusted WPM (accounting for accuracy)
    • Net WPM (corrected for errors)
  • Random sentence selection from a large pool of Rust-themed sentences
  • Professional results table with formatted metrics

Prerequisites

  • Rust 1.70 or higher
  • Cargo (comes with Rust)

Installation

  1. Clone or download this project
  2. Ensure output.txt is in the same directory as your source code
  3. Install dependencies:
cargo build --release

Usage

Run the application:

cargo run --release

How to Play

  1. The program will display a random sentence from output.txt
  2. Type the sentence exactly as shown and press Enter
  3. You'll receive immediate feedback showing correct (green) and incorrect (red) words
  4. Continue typing new sentences until the 60-second timer expires
  5. View your detailed typing statistics at the end

Project Structure

typing-test/
├── Cargo.toml          # Project dependencies and metadata
├── src/
│   └── main.rs         # Main application code
├── output.txt          # Sentence database (required)
└── README.md           # This file

Dependencies

  • rand (0.9) - Random number generation for sentence selection
  • colored (2.0) - Terminal text coloring
  • prettytable-rs (0.10) - Formatted table output
  • indicatif (0.17) - Progress bar visualization
  • clearscreen (4.0.2) - Terminal screen clearing
  • crossterm (0.27) - Cross-platform terminal manipulation

Configuration

Changing Test Duration

To modify the test duration, edit the time variable in main.rs:

let time = 60; // Change this value (in seconds)

Adding Custom Sentences

Add your own sentences to output.txt, with one sentence per line. The program will randomly select from all available sentences.

Statistics Explained

  • Total Words: Number of words you typed during the test
  • Correct Words: Number of words typed correctly
  • Errors: Number of words typed incorrectly
  • Accuracy: Percentage of correctly typed words
  • Raw WPM: Total words typed per minute (uncorrected)
  • Adjusted WPM: Raw WPM multiplied by accuracy
  • Net WPM: (Total words - Errors) per minute

Example Output

=== Typing Test ===
The quick brown fox jumps over the lazy dog while the sun sets behind...

Write the sentence here: The quick brown fox jumps over the lazy dog...
Feedback: The quick brown fox jumps over the lazy dog

=== Test Finished ===
45 total words!
42 of correct words!

+----------------+----------+
| Metric         | Value    |
+----------------+----------+
| Total Words    | 45       |
| Correct Words  | 42       |
| Errors         | 3        |
| Accuracy       | 93.33%   |
| Raw WPM        | 45.00    |
| Adjusted WPM   | 42.00    |
| Net WPM        | 42.00    |
+----------------+----------+

Tips for Improvement

  1. Practice regularly - Consistency is key to improving typing speed
  2. Focus on accuracy first - Speed will naturally increase with accuracy
  3. Use proper finger placement - Follow touch typing guidelines
  4. Don't look at the keyboard - Train your muscle memory
  5. Take breaks - Avoid fatigue by practicing in short sessions

Known Issues

  • The program expects output.txt to exist in the same directory
  • Input is case-sensitive and whitespace-sensitive
  • Progress bar updates only between sentences, not in real-time during typing

Future Improvements

  • Add difficulty levels (beginner, intermediate, advanced)
  • Save typing history and track progress over time
  • Add custom time duration selection
  • Real-time WPM display during typing
  • Multiplayer/competitive mode
  • Support for different languages

License

This project is open source and available for educational purposes.

Contributing

Feel free to fork this project and submit pull requests with improvements!

Acknowledgments

Built with love using Rust and various excellent crates from the Rust community.

About

A terminal-based typing speed test application built in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages