#🔒 PLEASE HELP ME WITH DEBUGGING NOKIA GAME PLS🥺

30 messages · Page 1 of 1 (latest)

spare elbow
#

im trying to make a nokia styled snake game, can anyone help me figure out why snake's body (list called segments) isnt following the head?
https://paste.pythondiscord.com/XPKA
CODE is pasted here

primal lodgeBOT
#

@spare elbow

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

spare elbow
#

for some reason, after eating the apple, it isnt appearing again, also now if i eat that first apple and then i move right or left, it still continues to increase the length

olive shuttle
#

this package requires root to run?

#

@spare elbow

spare elbow
#

just using cmd prompt

olive shuttle
#

i'm linux atm, says i need root to run this 😐

spare elbow
#

oh

#

for windows we can run easily on cmd prompt

#

on wait u copy pasted code?

spare elbow
olive shuttle
spare elbow
#

for linux

olive shuttle
#
Frames passed: 0
Traceback (most recent call last):
  File "/home/aaravind/Documents/Projects/JyProjects/scraps/nokia_snake.py", line 202, in <module>
    print_board()
  File "/home/aaravind/Documents/Projects/JyProjects/scraps/nokia_snake.py", line 164, in print_board
    key_moves()
  File "/home/aaravind/Documents/Projects/JyProjects/scraps/nokia_snake.py", line 22, in key_moves
    if keyboard.is_pressed("W") or keyboard.is_pressed("UP"):
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aaravind/miniconda3/envs/py311/lib/python3.11/site-packages/keyboard/__init__.py", line 410, in is_pressed
    _listener.start_if_necessary()
  File "/home/aaravind/miniconda3/envs/py311/lib/python3.11/site-packages/keyboard/_generic.py", line 35, in start_if_necessary
    self.init()
  File "/home/aaravind/miniconda3/envs/py311/lib/python3.11/site-packages/keyboard/__init__.py", line 196, in init
    _os_keyboard.init()
  File "/home/aaravind/miniconda3/envs/py311/lib/python3.11/site-packages/keyboard/_nixkeyboard.py", line 113, in init
    build_device()
  File "/home/aaravind/miniconda3/envs/py311/lib/python3.11/site-packages/keyboard/_nixkeyboard.py", line 109, in build_device
    ensure_root()
  File "/home/aaravind/miniconda3/envs/py311/lib/python3.11/site-packages/keyboard/_nixcommon.py", line 174, in ensure_root
    raise ImportError('You must be root to use this library on linux.')
ImportError: You must be root to use this library on linux.
#

so like it requires root to run

spare elbow
#

did u change clear?

#

and dont run it in pycharm, run it in cmd prompt

olive shuttle
olive shuttle
#

we'll wait for someone with windows

spare elbow
#

oki, thanks sadlike

olive shuttle
#

don't want to run some package with root 😬

hollow copper
#

There are still some bugs tho

spare elbow
primal lodgeBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.