Last updated: 2025-03-29
This assignment is due April 12th at 11:59 PM. Submit your solution on Brightspace, under the “Unit 10” assignment.
Please copy your code into the text box, making sure to indent it properly with whitespace so that it appears the same as in IDLE or wherever you wrote the code. This will make it easier for me to grade.
You can submit multiple times. I will only grade your last submission.
I have slightly modified the code for the Snake game to make it easier for you to do the assignment. If you had previously downloaded the game code, please replace it with the new version that I have uploaded (same link as before): New version of Snake code
Recall that in the original version of Snake that we saw in class, the game ended if the snake collided with a wall:
Modify the code for the Snake game we saw in class to make the snake come out on the opposite side of the screen instead of colliding with a wall:
snake[0]
.snake[0][0] = 0
to set the x-position of the snake’s head to 0.You should be able to do all of the tasks with only the Python topics we covered in class so far.
If you want to use more complex functionality than what we discussed in class, the Python documentation may be helpful: Python 3.10 documentation
Additionally, the Pygame documentation may be helpful: Pygame documentation