Repository navigation
Add sorting and unique filtering commands - #20
matthewjustice wants to merge 1 commit into
Conversation
| # TODO: Write a command to output scores-table.txt, with lines sorted by the person's first score, descending. | ||
| # The first line of your output should be "Basia London 22 9 6" (with no quotes). | ||
|
|
||
| sort -k3,3r scores-table.txt |
There was a problem hiding this comment.
The new line you added here is code only, with no comment. Since this review is focused on comments that might not add much value, there’s nothing to improve on this particular change. When you do add comments in the future, it can be useful to ask yourself: “Would this still be helpful to someone who already understands basic shell tools like sort?” If the answer is no, the code might be clear enough on its own.
To "like" or "dislike" this comment, please follow this link
| # TODO: Write a command to output scores-table.txt, with shows the line for the player whose first score was the second highest. | ||
| # Your output should be: "Piotr Glasgow 15 2 25 11 8" (without quotes). | ||
|
|
||
| sort -k3,3nr scores-table.txt | head -n 2 |
There was a problem hiding this comment.
Similar to the previous file, this line is pure code with no extra comment. That’s usually a good sign that you’re letting the code speak for itself. As you keep practicing, you might reflect on whether commands like sort ... | head -n 2 are self-explanatory to your intended audience. If they are, adding a comment that just restates what the command does might not be necessary.
To "like" or "dislike" this comment, please follow this link
| # The order they're displayed doesn't matter, but we never want to see the same event listed twice. | ||
| # Your output should contain 6 lines. | ||
|
|
||
| uniq events.txt |
There was a problem hiding this comment.
Here as well, there is no new comment, only the uniq command. In cases like this, the combination of the exercise description above and the shell command is usually enough for readers to understand the intent. If you ever feel tempted to add something like # remove duplicate events directly above uniq events.txt, you might ask yourself whether that comment would tell the reader anything they couldn’t already infer from the command name.
To "like" or "dislike" this comment, please follow this link
|
The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look. |
This PR is for testing the cyf-ai-code-reviewer