syscall assignment#21
syscall assignment#21gaurangivishwakarma-ui wants to merge 4 commits intoGit-Lecture-2026:syscallfrom
Conversation
typing test 2.0(better than ever).sh
Outdated
| calculate_wpm() { | ||
| local user_input="$1" | ||
| local time_elapsed="$2" | ||
| local word_count=$(echo "$user_input" | grep -o '[a-zA-Z]*' | wc -w) |
There was a problem hiding this comment.
Instead of spawning three different processes (this affects performance) to count words
Try using the here string operator (<<<) with wc
There was a problem hiding this comment.
If you find any other portion of the script using more than required external processes, try to reduce them. It is a good practice.
Also, the performance issues might not be very apparent rn, but a heavier program might struggle with too many such calls.
There was a problem hiding this comment.
ill keep this in mind for future projects and have updated the code to use string operator.
| while true; do | ||
| printf "1. Play Test\n2. View History & Graphs\n3. Quit\nChoose an option: " | ||
| read -r choice | ||
| case $choice in |
There was a problem hiding this comment.
You can use select to create a menu
Nothing wrong with this, but the purpose of select is to create an interactive menu
|
Pretty good code, lgtm |
okay, I'll read upon how to make good commit messages. |
This pull request contains the submission for Assignment 1, which includes the following components:
#Typing Test Utility
A monkeytype-style typing test fully implemented in Bash, featuring a text-based user interface (TUI) menu and progress graphs.
#Git Exercises Writeups
Documentation of Git exercises completed up to Level 12, with commands.
#Bandit Wargame Writeups
Writeups covering solutions and reasoning for Bandit levels 0–20, including step-by-step commands.