Context
format_scoreboard() truncates names to 14 characters with [:14], which stops
the columns shifting — but it cuts mid-word with no indication anything was
removed, so "Venkateswara Rao" becomes "Venkateswara R" and looks like a typo.
There is a second problem: a name containing a wide character (many emoji, or
CJK text) takes two terminal columns but counts as one character, so the row
still ends up misaligned.
What to change
File: arcade/scoreboard.py
Function: format_scoreboard()
- Truncate with an ellipsis so it is obvious text was cut:
Venkateswara…
- Handle wide characters.
unicodedata.east_asian_width() tells you whether a
character occupies two columns — count display width, not character count
- Keep every row the same rendered width
unicodedata is in the standard library, so this adds no dependency.
Acceptance criteria
How to verify locally
python3 -m pytest tests/test_scoreboard.py -v
python3 -m arcade # save a score under a very long name, view the board
Difficulty
Intermediate. Terminal width handling is genuinely fiddly and worth learning.
New here? Comment /claim on this issue and a bot will assign it to you. Then read CONTRIBUTING.md.
Stuck at any point? Comment here saying what you have tried, or come to a PR Debug Clinic (Oct 12 or Oct 21). Getting stuck is the normal experience of learning this, not a sign you are doing it wrong.
Context
format_scoreboard()truncates names to 14 characters with[:14], which stopsthe columns shifting — but it cuts mid-word with no indication anything was
removed, so "Venkateswara Rao" becomes "Venkateswara R" and looks like a typo.
There is a second problem: a name containing a wide character (many emoji, or
CJK text) takes two terminal columns but counts as one character, so the row
still ends up misaligned.
What to change
File:
arcade/scoreboard.pyFunction:
format_scoreboard()Venkateswara…unicodedata.east_asian_width()tells you whether acharacter occupies two columns — count display width, not character count
unicodedatais in the standard library, so this adds no dependency.Acceptance criteria
python3 -m pytestpassesHow to verify locally
python3 -m pytest tests/test_scoreboard.py -v python3 -m arcade # save a score under a very long name, view the boardDifficulty
Intermediate. Terminal width handling is genuinely fiddly and worth learning.
New here? Comment
/claimon this issue and a bot will assign it to you. Then read CONTRIBUTING.md.Stuck at any point? Comment here saying what you have tried, or come to a PR Debug Clinic (Oct 12 or Oct 21). Getting stuck is the normal experience of learning this, not a sign you are doing it wrong.