tessl install tessl/pypi-asciimatics@1.15.0A cross-platform package to replace curses (mouse/keyboard input & text colours/positioning) and create ASCII animations
Agent Success
Agent success rate when using this tile
81%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.33x
Baseline
Agent success rate without this tile
61%
Create a terminal application that displays multilingual messages with proper text alignment and formatting, supporting Unicode characters including double-width CJK (Chinese, Japanese, Korean) characters.
Your application should:
Create a program that displays the following messages on the terminal screen:
Implement a function that right-aligns text within a specified width, properly accounting for double-width CJK characters:
The application should run for 3 seconds to allow viewing the output, then exit cleanly.
@generates
def display_messages(screen):
"""
Display multilingual messages on the terminal screen.
Args:
screen: The terminal screen object for rendering
"""
pass
def right_align_text(text, width):
"""
Calculate proper spacing for right-aligning text with CJK characters.
Args:
text: The text string containing ASCII and/or CJK characters
width: The total width to align within
Returns:
The number of spaces needed for right alignment
"""
passProvides terminal control and Unicode text support.