Skip to content

syscall assignment#21

Open
gaurangivishwakarma-ui wants to merge 4 commits intoGit-Lecture-2026:syscallfrom
gaurangivishwakarma-ui:syscall
Open

syscall assignment#21
gaurangivishwakarma-ui wants to merge 4 commits intoGit-Lecture-2026:syscallfrom
gaurangivishwakarma-ui:syscall

Conversation

@gaurangivishwakarma-ui
Copy link

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.

calculate_wpm() {
local user_input="$1"
local time_elapsed="$2"
local word_count=$(echo "$user_input" | grep -o '[a-zA-Z]*' | wc -w)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of spawning three different processes (this affects performance) to count words
Try using the here string operator (<<<) with wc

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use select to create a menu
Nothing wrong with this, but the purpose of select is to create an interactive menu

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remeber.

@peopleig
Copy link

Pretty good code, lgtm
The script runs very well
Good work on using mapfile - script loads smoothly
Try to not use echo and clear in a lot of places unnecessarily.
Make these small changes and then you can submit
And read the guidelines on writing commits. Can't use past tense in them

@gaurangivishwakarma-ui
Copy link
Author

Pretty good code, lgtm The script runs very well Good work on using mapfile - script loads smoothly Try to not use echo and clear in a lot of places unnecessarily. Make these small changes and then you can submit And read the guidelines on writing commits. Can't use past tense in them

okay, I'll read upon how to make good commit messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants