Aqui está um exemplo simples de código em Python para o jogo Pong:

    # O código
    import turtle
    import os

    # Configuração da janela
    window = turtle.Screen()
    window.title("Pong")
    window.bgcolor("black")
    window.setup(width=600, height=400)
    
    # Desenhando a rede
    net = turtle.Turtle()
    net.speed(0)
    net.color("white")
    net.penup()
    net.goto(0, 0)
    net.pendown()
    net.setheading(270)
    for i in range(10):
        net.forward(20)
        net.penup()
        net.forward(20)
        net.pendown()
    
    # Criando os jogadores
    player_a = turtle.Turtle()
    player_a.speed(0)
    player_a.shape("square")
    player_a.color("white")
    player_a.shapesize(stretch_wid=5, stretch_len=1)
    player_a.penup()
    player_a.goto(-250, 0)
    
    player_b = turtle.Turtle()
    player_b.speed(0)
    player_b.shape("square")
    player_b.color("white")
    player_b.shapesize(stretch_wid=5, stretch_len=1)
    player_b.penup()
    player_b.goto(250, 0)
    
    # Criando a bola
    ball = turtle.Turtle()
    ball.speed(40)
    ball.shape("circle")
    ball.color("white")
    ball.penup()
    ball.goto(0, 0)
    ball.dx = 2
    ball.dy = 2
    
    # Movendo os jogadores
    def move_up_a():
        y = player_a.ycor()
        y += 20
        player_a.sety(y)
    
    def move_down_a():
        y = player_a.ycor()
        y -= 20
        player_a.sety(y)
    
    def move_up_b():
        y = player_b.ycor()
        y += 20
        player_b.sety(y)
    
    def move_down_b():
        y = player_b.ycor()
        y -= 20
        player_b.sety(y)
    
    # Configurando as teclas de controle
    window.listen()
    window.onkeypress(move_up_a, "w")
    window.onkeypress(move_down_a, "s")
    window.onkeypress(move_up_b, "Up")
    window.onkeypress(move_down_b, "Down")
        
    # Loop principal do jogo
    while True:
        window.update()
    
        # Movendo a bola
        ball.setx(ball.xcor() + ball.dx)
        ball.sety(ball.ycor() + ball.dy)
    
        # Verificando colisão com as bordas superior e inferior
        if ball.ycor() > 190 or ball.ycor() < -190:
            ball.dy *= -1
    
        # Verificando colisão com os jogadores
        if ball.xcor() > 240 and (player_b.ycor() + 50 > ball.ycor() > player_b.ycor() - 50):
            ball.dx *= -1
        elif ball.xcor() < -240 and (player_a.ycor() + 50 > ball.ycor() > player_a.ycor() - 50):
            ball.dx *= -1
    
        # Verificando se a bola passou pelos jogadores
        if ball.xcor() > 290:
            ball.goto(0, 0)
            ball.dx *= -1
            elif ball.xcor() < -290:
            ball.goto(0, 0)
            ball.dx *= -1
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence