-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix inconsistent printing of meditation #289
Conversation
This fixes the issues I observed while solving the koans. Some of the issues I noticed are: - Random vertical position of printing koans - Sometimes koan intro printed before clear screen - Next koan does not appear when all koan passes for a module
This improves progress bar by: - Adding progress percentage - Calculating progress bar underline based on the text length of progress bar
end | ||
|
||
defp calculate_progress(current, total) do | ||
round(current / total * @progress_bar_length) | ||
end | ||
|
||
defp calculate_percentage(current, total) do | ||
Float.round(current / total * 100, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this would look better without any decimal places?
0 of 12 -> 0% complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be useful for people like me who wants to know the progress a little more precisely. But either way it's fine doesn't matter too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion. I tend to agree that decimals aren't terribly useful in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes lgtm. Since Felipe is around (and had a hand in writing this afaicr), I'll defer to him for approval.
Thank you for this! |
This fixes the issues I observed while solving the koans. Some of the issues I noticed are: