Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turtle_graphics.py updation needed . #153

Open
Soyvor opened this issue Apr 11, 2024 · 0 comments
Open

turtle_graphics.py updation needed . #153

Soyvor opened this issue Apr 11, 2024 · 0 comments

Comments

@Soyvor
Copy link

Soyvor commented Apr 11, 2024

Choice Function: Replaced sample with choice for selecting a single random item from a sequence. This simplifies the code when only one random choice is needed.

Pen State Functions: Corrected the function names from pu and pd to penup and pendown, respectively, for clarity and consistency.

Position Copy: Used the copy() method to create a copy of the position vector before modifying it. This prevents unintended changes to the original position vector.

Distance Calculation: Replaced abs(tt.pos() - start_position) with tt.distance(start_position) to calculate the distance between two points more accurately.

Indentation and Formatting: Ensured consistent indentation and formatting throughout the code for readability and maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant