Exercise 1 · Chapter: Your First FrameRequired+50 XP
Sky and Ground
Every animation starts with one still picture.
Write draw(state) so it returns a blank grid — blue sky with dirt along the
bottom. Nothing else. No moving parts yet.
This is the smallest possible frame, and it is the contract every chapter after this one builds on: take a state, return a picture.
Expected output
........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ########################################
Need a hint?
3 available · costs 5 XP each
python
def draw(state):
grid = blank_grid()
# One line missing: hand the picture back.