CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-asciimatics

tessl install tessl/pypi-asciimatics@1.15.0

A 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%

task.mdevals/scenario-3/

Animated Terminal Display

Build a terminal display system that shows multiple updating elements without screen flicker.

Requirements

Implement a program that displays the following on a terminal screen:

  1. A counter that increments from 0 to 100, displayed at position (10, 5)
  2. A status message that alternates between "Processing..." and "Working..." every 10 counts, displayed at position (10, 7)
  3. A progress bar showing the counter progress with a width of 30 characters, displayed at position (10, 9)

The display must update smoothly without flicker. All three elements should update together on each iteration with a 0.1 second delay between updates.

Display Format

  • Counter: "Count: X" where X is the current count (0-100)
  • Status: Either "Processing..." or "Working..."
  • Progress bar: "[" + filled portion + empty portion + "] X%" where filled uses "=" characters and empty uses " " characters

Test Cases

  • The counter starts at 0 and ends at 100 @test
  • The status message alternates correctly based on the counter value @test
  • The progress bar correctly represents the percentage (e.g., 50% fills 15 of 30 characters) @test
  • All screen updates use proper buffering to avoid flicker @test

Implementation

@generates

Create a display.py file with a run_display(screen) function that performs the animated display. The function should accept a screen object and handle all rendering operations.

API

def run_display(screen):
    """
    Display an animated counter with status and progress bar.

    Parameters:
    - screen: A screen object with methods for terminal control

    The function should:
    - Clear the screen buffer at the start
    - Loop from 0 to 100 (inclusive)
    - Update counter, status message, and progress bar
    - Use proper buffering to prevent flicker
    - Include 0.1 second delay between updates
    """

Dependencies { .dependencies }

asciimatics { .dependency }

Provides terminal screen control and rendering capabilities.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/asciimatics@1.15.x
tile.json