Skip to content

LukeS190/Lab4

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lab 4

Turtle Graphics

All of the methods for this lab will be written in the TurtleGraphics.py file. In your main() function, you can uncomment one of the function calls. You only need to do one at a time but each of the given commands should work.

Using CodeHS

There are two ways to work on this assignment.

  • Copy/paste the code from TurtleGraphics.py into a Code HS using the Python with Turtle option.
    • Then when you are done, copy/paste back to your Github
  • Copy/paste into your computer's Python IDE
    • Again you can copy/paste back to Github when you're done.

drawPolygon(turtle, sides)

Will draw a polygon given the number of sides.

fillCorner(turtle, corner)

Draws a square with one of the corners filled in. Imagine that your square is divided with a horizontal and vertical line. Fill in one of the quadrants based on the input that the function is given. 1 - Top left 2 - Top right 3 - Bottom left 4 - Bottom right

Filled Square

squaresInSquares(turtle, num)

Draws multiple squares within the previous squares. The given number will be how many squares should be on the screen.

Squares in Squares


Testing your code

You may not actually know that your code works until you fully test what you have written. It is often a good idea to get someone else to run your program, they may do something you had not anticipated which could show you a possible flaw or at least a design issue.

End of class

  • Add a commit message
  • Commit to GitHub
  • Sync work with Repo
  • Submit your repo link to Canvas

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%