Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Board:
- def __init__(self, x, y, w, h, r, c):
- self.x = x
- self.y = y
- self.w = w
- self.h = h
- self.r = r
- self.c = c
- self.colors = [(255, 255, 255),
- (0, 0, 0)]
- def draw(self):
- for i in range(self.r):
- for j in range(self.c):
- pygame.draw.rect(wn, self.colors[(j + i) % 2],
- (self.x + j * self.w,
- self.y + i * self.h,
- self.w, self.h))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement