Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- x, y = map(int, input().split())
- n = x // y
- size = width, height = x, x
- sc = pygame.display.set_mode(size)
- sc.fill((255, 255, 255))
- for ii in range(0, y):
- for i in range(0, y, 2):
- if ii % 2 == 0:
- pygame.draw.rect(sc, (0, 0, 0),
- (n * ii, x - n - n * i, n, n))
- if ii % 2 != 0:
- pygame.draw.rect(sc, (0, 0, 0),
- (n * ii, x - n - n * i + n, n, n))
- pygame.display.flip()
- while pygame.event.wait().type != pygame.QUIT:
- pass
- pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement