0
why wont my code work?
i copyid this from chatgpt to learn the code and it doesn’t work can someone give me tips please? https://sololearn.com/compiler-playground/ctaOxt80eO3P/?ref=app
2 odpowiedzi
+ 1
you can't run curses in Sololearn. The output is not displayed in a terminal here.
Ansi codes and terminal functions like endwin() don't work, as you can see from the output and error message.
Also while loops for games to receive user inputs are also impossible in Sololearn, except in web codes. All inputs are through the popup box and the time limit for code execution is very short.
i tried your code in my laptop and it's pretty cool.
i modified the code so that it restart instead of quit whenever the snake dies. i mapped quit to 'q' or 'esc'. this way I don't need to keep restarting the code. I even colored the snake and the food.
maybe you can do it a snake game with Skulpt or Brython?
+ 1
thanks Bob_Li this is a different app than i used to use when i just printed things so i didnt know that thanks a lot tho