Skip to content

Latest commit

 

History

History
89 lines (64 loc) · 2.26 KB

README.md

File metadata and controls

89 lines (64 loc) · 2.26 KB

⌨️ Typing Practice Program - R-Typing 🦀

📖 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.

I\’m still learning Rust, so feedback and corrections are very welcome!

sample1

sample2

⚙️ How to Run in VSCode

  1. Open the main file in VSCode.
  2. Click the ▶ Run button above the fn main() function.
  3. Alternatively, run the following commands in the terminal:
# Default
cargo run

# or
cargo run -- --timeout 30 --level 20 --sound

🔨 Build and Install

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

cargo check
cargo build --release
cargo install --path .

💻 Usage

R-Typing: A terminal-based typing practice app.

Usage: rtyping [OPTIONS]

Options:
  -t, --timeout <TIMEOUT>  Seconds [default: 60]
  -l, --level <LEVEL>      Number of words [default: 9]
  --freq <FREQUENCY>       Frequency📶 e.g, 800.0 or 480.0
  -s, --sound              Turn BGM🔊
  -h, --help               Print help

✅ Features and To-Do List

Completed Features

  • Timeout functionality during user input.
  • Accept user input.
  • Display words on the screen.
  • Use Rust's basic random functions.
  • Add decorative strings to enhance visuals.
  • Display a countdown timer in the top-left corner.
  • Resolve Backspace handling issues in raw mode.
  • Avoid bugs with termion::clear::All by using alternative methods.
  • Calculate WPM (Words Per Minute).
  • Add background music (BGM).
  • Include sound effects for typing.
  • Handle external asset files during build.
  • Restore terminal state after exiting raw mode.
  • Add command-line options for customization.
  • Validate command-line arguments.
  • Change cursor style when user input.

🔖 Appendix

🛠 Cross-Compilation Instructions

For Apple silicon

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