AutoSkill 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.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/create-codesters-screen-saver-with-try-except-validation" ~/.claude/skills/ecnu-icalk-autoskill-create-codesters-screen-saver-with-try-except-validation && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/create-codesters-screen-saver-with-try-except-validation/SKILL.mdsource content
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
- Library Usage: Use the
library exclusively. Do not usecodesters
.tkinter - Code Structure: Organize the code into three distinct sections: Helper Functions, Main Function, and execution.
- Helper Function 1 (Input Validation):
- Create a function (e.g.,
) that prompts the user for shape type, color, x-speed, y-speed, and whether to add more shapes.get_user_input - Use
blocks to validate input, specifically checking for valid numbers (ValueError).try-except - Use
for user input to avoid attribute errors withcodesters.prompt()
.ask() - Return a list of the user's responses.
- Create a function (e.g.,
- Helper Function 2 (Shape Creation):
- Create a function (e.g.,
) that accepts the user input list.make_shapes - Unpack the list to retrieve shape, color, x_speed, y_speed, and more_shapes.
- Create the specified shapes (
,Square
,Circle
) usingTriangle
.codesters - Set the x and y speeds using
andset_x_speed()
.set_y_speed() - Return a boolean indicating if more shapes should be added.
- Create a function (e.g.,
- Main Function:
- Create a
function that initializes the stage (main()
).codesters.Display() - Set the backdrop color using
.stage.set_backdrop_color() - Create a sprite (e.g.,
) to facilitate interaction.codesters.Sprite("alien2") - Loop through the shape creation process based on the user's input.
- Create a
- Error Handling: Handle invalid inputs gracefully within the try-except blocks using
orprint()
. Do not usesprite.say()
.codesters.caught()
Anti-Patterns
- Do not use
.tkinter - Do not use
orstage.clear()
.stage.set_background_color() - Do not use
orcodesters.ask()
on the Display object; usesprite.ask()
.codesters.prompt() - Do not use
for error handling.codesters.caught()
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