Skip to content

Upload Assignment for xylo#10

Open
devyarustagi wants to merge 9 commits intoGit-Lecture-2026:xylofrom
devyarustagi:xylo
Open

Upload Assignment for xylo#10
devyarustagi wants to merge 9 commits intoGit-Lecture-2026:xylofrom
devyarustagi:xylo

Conversation

@devyarustagi
Copy link

No description provided.

@TanmayArya-1p
Copy link

TanmayArya-1p commented Mar 14, 2026

@TanmayArya-1p
Copy link

image

If i don't type anything then it errors out, take care of edge cases like this

@TanmayArya-1p
Copy link

Also, try to make an interactive TUI something like this that highlights the currently typed text red if its wrongly typed in.
Other stuff you can do if you get time after making the TUI: #9 (comment)

@TanmayArya-1p
Copy link

TanmayArya-1p commented Mar 15, 2026

Good work on the TUI.

More things to do:

  • Center align the entire TUI
  • Take the word count in via a command line flag to the bash script. If the user doesn't specify a word count using this flag, then prompt them normally.
  • Also, don't do the base64 hack you are doing right now for the banner cuz it looks very sus at first glance(using b64 is a common trick to load malware in bash scripts 💀). Instead copy paste the ascii into the file and use a multi line cursor to echo out each line individually.
  • Maybe include multiple word lists for different difficulties. Higher difficulties will have words with punctuation. Take input for difficulty through a CLI flag or TUI prompt just like word count.

Once you do the above things, you can take a 2nd review from another 2y before submission.

I also want to give you something interesting to do: Add a timed mode which should display a timer that updates every second. Think about how you would do this with common OS primitives.

Hints fork and signal handlers(you can also do it other ways if you find them to be simpler)

@TanmayArya-1p TanmayArya-1p mentioned this pull request Mar 15, 2026
@peopleig
Copy link

Good job
I tried to break it, couldn't find any bugs
I noticed that you haven't implemented the timer display that tcan suggested. But no issues
LGTM

difficulty=0


while getopts ":w:d:" flag ; do

Choose a reason for hiding this comment

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

Minor suggestion
You should add a simple help flag: -h, explaining which flags are used, what values are accepted
Since getopts won't accept longer flags, so only -h, not --help

w)
if (( OPTARG < 1 || OPTARG > 359 )); then
echoc -N "Invalid value $OPTARG: must be between 0 and 360."
kill -INT $$

Choose a reason for hiding this comment

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

Could just use exit 1
Nothing wrong with this though

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.

3 participants