TASK 1

Hungry Snake

The snake in snake has forgotten how to eat!

Since eating is how you score, this needs to be implemented.


You must complete the procedure:

def has_eaten(snakeX: int, snakeY: int):

The variables foodX and foodY are global variables representing the current position of the food. The local variables snakeX and snakeY are the current co-ordinates of the head of the snake.

The whole game is played on a grid of size numRows by numCols.

You can see the code which sets the first position of the food, use this to set a new food position once the current food has been eaten.

To increase your score, call the procedure add_snake().


If you are successful, the end-task pop-up will appear.

Feel free to close the pop-up and play the game, you've earned it


Good Luck!

Well done!

You have completed all of the tasks.

Return home or take a look at the tutorials

Something isn't quite right...

Close this message and have another go!

GUIDE

This guide is intended to help with syntax. See the prelude section for pre-defined functions and variables. See the tutorials page for tutorials on how to write code.



Can't find what you're looking for?

Check the tutorials page for more!

PRELUDE

The prelude is all the pre-defined functions and variables available to use. See the tutorials page for tutorials on how to write code.



Can't find what you're looking for?

Check the tutorials page for more!