practicas de python pensamiento computacional
PRIMER CÓDIGO GENERADO EN CHST GPT VERSIÓN 3.5
import pygame
import sys # Inicializar pygame pygame.init() # Configuración de la ventana width, height = 800, 600 screen = pygame.display.set_mode((width, height)) pygame.display.set_caption( screen = pygame.display.set_mode((width, height)) pygame.display screen = pygame.display.set_mode((width, height)) pygame "Simulación de Disección Muscular") # Definir colores white = (255, 255, 255) red = (255, 0, 0) # Definir un músculo simulado (en este caso, un rectángulo rojo) muscle = pygame.Rect(200, 200, 200, 100) running = True dissected = dis False while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False if event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE: # Al presionar la barra espaciadora, "diseccionamos" el músculo dissected = True screen.fill(white) if not dissected: pygame.draw.rect(screen, red, muscle) pygame.draw.rect(screen else: # Si se ha diseccionado, muestra el músculo "diseccionado" pygame.draw.rect(screen, white, muscle) pygame.draw.line(screen, red, ( pygame.draw.rect(screen, white, muscle) pygame.draw.rect(screen, white, muscle pygame.draw.rect(screen, 400, 200), (400, 300), 5) pygame.display.flip() pygame.quit() sys.exit() pygame.displayCONCLUSIONES. SE HIZO EL COPY PASTE DEL CÓDIGO EN COLABORATORY DE GOOGLE EL CUAL NO PUDO RECONOCERLO. SE REALIZARA EL SEGUIMIENTO Y MODIFICACIÓN PARA PERFECCIONARLO
Comentarios
Publicar un comentario