<commit_before>import os
import pygame

os.environ["SDL_VIDEO_CENTERED"] = "1"

pygame.init()

resolution = [1024, 768]
screen = pygame.display.set_mode(resolution)
pygame.display.set_caption("Pictionary clone")
clock = pygame.time.Clock()

pen_color = [0, 0, 0]
drawing_pad_color = [255, 255, 155]

drawing_size = [500, 500]
drawing_pad = pygame.Surface(drawing_size)
drawing_pad.fill(drawing_pad_color)
drawing_pad_pos = [40, 40]

isRunning = True
while isRunning:
    screen.fill([255, 255, 255])

    pygame.draw.rect(screen,
                     [0, 0, 0],
                     drawing_pad.get_rect().move(drawing_pad_pos),
                     10)  # draw border
    screen.blit(drawing_pad, drawing_pad_pos)

    mouse_down = pygame.mouse.get_pressed()
    if mouse_down[0] or mouse_down[2]:
        color = pen_color if mouse_down[0] else drawing_pad_color
        mouse_pos = pygame.mouse.get_pos()

        # offset mouse position by the drawing area
        mouse_pos = [mouse_pos[0] - drawing_pad_pos[0],
                     mouse_pos[1] - drawing_pad_pos[1]]

        pygame.draw.circle(drawing_pad,
                           color,
                           mouse_pos,
                           10)
        mouse_movements = pygame.mouse.get_rel()
        print(mouse_movements)

    pygame.display.update()
    clock.tick(60)
    for event in pygame.event.get():
        if (event.type == pygame.QUIT or
           (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE)):
            pygame.quit()
            isRunning = False<commit_msg>added delta for pen movement<commit_after>import os
import pygame

os.environ["SDL_VIDEO_CENTERED"] = "1"

pygame.init()

resolution = [1024, 768]
screen = pygame.display.set_mode(resolution)
pygame.display.set_caption("Pictionary clone")
clock = pygame.time.Clock()

pen_color = [0, 0, 0]
drawing_pad_color = [255, 255, 155]

drawing_size = [500, 500]
drawing_pad = pygame.Surface(drawing_size)
drawing_pad.fill(drawing_pad_color)
drawing_pad_pos = [40, 40]

drawing_delta = 0

isRunning = True
while isRunning:
    screen.fill([255, 255, 255])

    pygame.draw.rect(screen,
                     [0, 0, 0],
                     drawing_pad.get_rect().move(drawing_pad_pos),
                     10)  # draw border
    screen.blit(drawing_pad, drawing_pad_pos)

    mouse_down = pygame.mouse.get_pressed()
    if mouse_down[0] or mouse_down[2]:
        color = pen_color if mouse_down[0] else drawing_pad_color
        mouse_pos = pygame.mouse.get_pos()

        # offset mouse position by the drawing area
        mouse_pos = [mouse_pos[0] - drawing_pad_pos[0],
                     mouse_pos[1] - drawing_pad_pos[1]]

        pygame.draw.circle(drawing_pad,
                           color,
                           mouse_pos,
                           10)
        mouse_movements = pygame.mouse.get_rel()
        drawing_delta += sum(map(abs, mouse_movements))

    pygame.display.update()
    clock.tick(60)
    for event in pygame.event.get():
        if (event.type == pygame.QUIT or
           (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE)):
            pygame.quit()
            isRunning = False
{'fraction_non_alphanumeric': 0.10836204196680238, 'fraction_numerical': 0.03476354525524585, 'mean_word_length': 2.3621052631578947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5113419', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1049, 'n_words': 209}