0

Can anyone solve and explain the error in this code. Pls

https://code.sololearn.com/cAntKCCr3160/?ref=app

1st Nov 2019, 11:13 AM
Thakur Lion😎😎
Thakur Lion😎😎 - avatar
3 Respostas
+ 1
Try to read the error messages carefully. They always indicate the line number where the code went wrong, and some clue about the reason. One thing is that addch() expects integer coordinates and you pass them floats. One way to fix, is to use // division instead of just / so in lines 11, 12 and 19: snk_x=sw//4 snk_y=sh//2 food=[sh//2,sw//2] And an equal sign is missing in line 29: new_head = [snake[0][0],snake[0] [1]]
1st Nov 2019, 5:34 PM
Tibor Santa
Tibor Santa - avatar
0
Thank u
2nd Nov 2019, 5:11 PM
Thakur Lion😎😎
Thakur Lion😎😎 - avatar
0
But it is returning error on line 27 : returned err. something like this
2nd Nov 2019, 5:14 PM
Thakur Lion😎😎
Thakur Lion😎😎 - avatar