write a python program that uses pygame to draw a circle
Jump to turn (6)
- 1write a python program that uses pygame to draw a circle
- 2write a python program that uses pygame to draw a house
- 3add to the program to draw a person standing next to the house
- 4change the background color to light blue and draw the ground
- 5continue
- 6write code that would allow the user to move the person with the arrow keys
- User
write a python program that uses pygame to draw a circle
- Assistant
Sure! Here's a simple Python program using the pygame library to draw a circle:
pythonimport pygame import sys # Initialize pygame pygame.init() # Set up the display width, height = 640, 480 screen = pygame.display.set_mode((width, height)) pygame.display.set_caption("Draw Circle") # Set up colors white = (255, 255, 255) red = (255, 0, 0) # Main loop running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # Draw a red circle pygame.draw.circle(screen, red, (width // 2, height // 2), 50) # Update the display pygame.display.flip() # Quit the program pygame.quit() sys.exit()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.