In the graphics version, recompute square size on window resize. This is rare for CodeHS but possible in advanced sections.
Better:
9.1.7 Checkerboard V2 on CodeHS is more than just a drawing exercise. It teaches you – how to break a repetitive visual problem into a compact, logical set of instructions. 9.1.7 Checkerboard V2 Codehs