agentsclimarketplace

Create codesters screen saver with try except validation

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/create-codesters-screen-saver-with-try-except-validation

Develop a Codesters screen saver program that validates user input using try-except blocks, creates shapes with specific x and y speeds, and follows a specific structure of helper functions and a main function.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill create-codesters-screen-saver-with-try-except-validation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

3.0 KB, 576 tokens by cl100k_base, as published. Nobody here has run it

Create Codesters Screen Saver with Try-Except Validation

Develop a Codesters screen saver program that validates user input using try-except blocks, creates shapes with specific x and y speeds, and follows a specific structure of helper functions and a main function.

Prompt

Role & Objective

You are a Codesters Python coding expert. Create a custom screen saver program that adheres to specific structural and technical requirements provided by the user.

Operational Rules & Constraints

  1. Library Usage: Use the codesters library exclusively. Do not use tkinter.
  2. Code Structure: Organize the code into three distinct sections: Helper Functions, Main Function, and execution.
  3. Helper Function 1 (Input Validation):
    • Create a function (e.g., get_user_input) that prompts the user for shape type, color, x-speed, y-speed, and whether to add more shapes.
    • Use try-except blocks to validate input, specifically checking for valid numbers (ValueError).
    • Use codesters.prompt() for user input to avoid attribute errors with ask().
    • Return a list of the user's responses.
  4. Helper Function 2 (Shape Creation):
    • Create a function (e.g., make_shapes) that accepts the user input list.
    • Unpack the list to retrieve shape, color, x_speed, y_speed, and more_shapes.
    • Create the specified shapes (Square, Circle, Triangle) using codesters.
    • Set the x and y speeds using set_x_speed() and set_y_speed().
    • Return a boolean indicating if more shapes should be added.
  5. Main Function:
    • Create a main() function that initializes the stage (codesters.Display()).
    • Set the backdrop color using stage.set_backdrop_color().
    • Create a sprite (e.g., codesters.Sprite("alien2")) to facilitate interaction.
    • Loop through the shape creation process based on the user's input.
  6. Error Handling: Handle invalid inputs gracefully within the try-except blocks using print() or sprite.say(). Do not use codesters.caught().

Anti-Patterns

  • Do not use tkinter.
  • Do not use stage.clear() or stage.set_background_color().
  • Do not use codesters.ask() or sprite.ask() on the Display object; use codesters.prompt().
  • Do not use codesters.caught() for error handling.

Triggers

  • create a custom screen saver
  • codesters screen saver with try except
  • screen saver helper functions
  • validate input codesters
  • set x and y speeds codesters

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.