epgfm / tuto6

Tutorat Programmation 6
Do What The F*ck You Want To Public License
0 stars 1 forks source link

Incorrect test - getNextPosition(snake) #2

Closed Matthieu-Riou closed 7 years ago

Matthieu-Riou commented 7 years ago

getNextPosition([[0, 0], [1, 0], 'red', True, 1]) (1, 0) getNextPosition([[0, 0], [0, 1], 'red', True, 1]) (0, 1)

Just return the speed vector (snake[1]) validates all the tests, because we only test with a starting position at [0,0].

epgfm commented 7 years ago

Can you propose a test to defeat this incorrect implementation?

Matthieu-Riou commented 7 years ago

Yes I can

Matthieu-Riou commented 7 years ago

Sorry, I'm so funny.

>>> getNextPosition([[4, 0], [-1,0], 'red', True, 1]) (3,0)

epgfm commented 7 years ago

https://github.com/epgfm/tuto6/commit/ead8941c5975554bbda0cd861b69f78c9e31d7f1

Thanks