Closed Matthieu-Riou closed 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].
Can you propose a test to defeat this incorrect implementation?
Yes I can
Sorry, I'm so funny.
>>> getNextPosition([[4, 0], [-1,0], 'red', True, 1]) (3,0)
https://github.com/epgfm/tuto6/commit/ead8941c5975554bbda0cd861b69f78c9e31d7f1
Thanks
Just return the speed vector (snake[1]) validates all the tests, because we only test with a starting position at [0,0].