+ 1
I donāt get where is the error. Help.
Click down šš» https://code.sololearn.com/cbWKQkckQIRX/?ref=app Thank you very much for your time and helpššš.
1 Answer
+ 4
Missing closing square bracket ,missing Indentations and a colon after while loop ,also curses doesn't have attribute intscr,
new_head = [snake [0][0], snake[1][0]]
if key == curses.KEY_DOWN:
new_head [0] += 1
if key == curses.KEY_UP:
new_head [0] -= 1
if key == curses.KEY_LEFT:
new_head [1] -= 1
if key == curses.KEY_RIGHT:
new_head [1] += 1
snake.insert (0, new_head)
if snake [0] == food:
food = None
while food is None:
nf = [
random.randint(1, sh-1),
random.randint(1, sw-1)
]