Skip to content

⌨️ Typing app on terminal 🦀

Notifications You must be signed in to change notification settings

tkumata/rtyping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

328 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⌨️ R-Typing - Typing Program 🦀

📖 Overview

R-Typing is a terminal-based typing practice application created as a learning project for Rust. The app is designed with simplicity in mind, focusing on essential features for a fun and educational experience. It features a modern TUI, real-time WPM calculation, and procedurally generated sentences.

sample1 sample2 sample3 sample4

⚙️ How to Run

  1. Ensure you have the Rust toolchain installed.
  2. Clone the repository and navigate to the project directory.
  3. Run the following commands in the terminal:
# Default run
cargo run

# Run with custom options
cargo run -- --timeout 30 --level 20 --sound

🔨 Build and Install

To build and install the application in your ~/.cargo/bin/ directory:

cargo build --release
cargo install --path .

💻 Usage

R-Typing: A terminal-based typing app.

Usage: rtyping [OPTIONS]

Options:
  -t, --timeout <TIMEOUT>    Timer duration in seconds [default: 60]
  -l, --level <LEVEL>        Number of words to generate [default: 30]
      --freq <FREQUENCY>     Feedback sound frequency in Hz [default: 80.0]
  -s, --sound                Enable background music (BGM)
  -h, --help                 Print help

✅ Features

  • TUI (Text User Interface): Rich terminal interface built with ratatui and crossterm.
  • Procedural Sentence Generation: Uses a 4-gram Markov Chain to generate natural-feeling English sentences from a sample text.
  • Real-time Feedback:
    • Visual indicators for correct (green) and incorrect (red background) characters.
    • Real-time WPM (Words Per Minute) calculation.
    • Interactive countdown timer with color-coded urgency.
  • Audio Experience:
    • Optional background music (BGM) playback using rodio.
    • Auditory feedback (sine wave beep) on correct keypresses.
  • Customizable Experience: Command-line arguments to adjust time limits, sentence length, and sound settings.
  • Responsive Controls: Supports standard typing controls including Backspace and Esc to finish early.

🔖 Appendix

🛠 Cross-Compilation Instructions

For Apple silicon (macOS):

rustup target add aarch64-apple-darwin
cargo build --release --target=aarch64-apple-darwin

For Windows (x86_64):

rustup target add x86_64-pc-windows-gnu
cargo build --release --target=x86_64-pc-windows-gnu

About

⌨️ Typing app on terminal 🦀

Topics

Resources

Stars

Watchers

Forks

Languages