Skip to content
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

Merged
merged 4 commits into from
Mar 27, 2024

Conversation

Iftakharpy
Copy link
Contributor

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

Iftakharpy and others added 4 commits March 1, 2024 00:43
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)
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

@Iftakharpy Iftakharpy requested a review from felipesere March 3, 2024 09:52
Copy link
Collaborator

@iamvery iamvery left a 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.

@felipesere
Copy link
Collaborator

Thank you for this!

@felipesere felipesere merged commit 2921a74 into elixirkoans:master Mar 27, 2024
1 check passed
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