femto / snake_game_py

a repository completely written by ai
1 stars 0 forks source link

Fix missing argument in Food class constructor #10

Open codez-bot[bot] opened 1 year ago

codez-bot[bot] commented 1 year ago

Description

This PR fixes the issue where the Food class in snake_game_py/food.py was missing a required positional argument snake_segments in its __init__ method. This argument is used to ensure that the generated food position is not on the snake.

Summary of Changes

Please review and merge this PR. Thank you!

Fixes #8.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/fix-missing-argument_1

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

femto commented 1 year ago

Traceback (most recent call last): File "/Users/femtozheng/python-project/snake_game_py/main.py", line 80, in game = Game() ^^^^^^ File "/Users/femtozheng/python-project/snake_game_py/main.py", line 22, in init self.food = Food() ^^^^^^ TypeError: Food.init() missing 1 required positional argument: 'snake_segments'

femto commented 1 year ago

Traceback (most recent call last): File "/Users/femtozheng/python-project/snake_game_py/main.py", line 80, in game = Game() ^^^^^^ File "/Users/femtozheng/python-project/snake_game_py/main.py", line 22, in init self.food = Food() ^^^^^^ TypeError: Food.init() missing 1 required positional argument: 'snake_segments'

femto commented 1 year ago

hi:retry