201# image data generated from https://tools.withcode.uk/bitmap/
2from imagedata import sock
3import withcode
4import time
5print("Anti Bullying Week: Happy Odd socks day")
6
7i = withcode.Image()
8while True:
9for y in range(32):
10for x in range(32):
11# swap the pixel colours around
12r, g, b = sock[y][x]
13sock[y][x] = [g, b, r]
14i.draw(sock)
15time.sleep(1)
16
17# Challenges
18# 1) Use a different picture
19# 2) Speed up the animation
20# 3) Draw two socks on the screen at the same time