#๐ My Battle function repeatedly spits out the enemy attacking and the rest of the function doesnt wo
20 messages ยท Page 1 of 1 (latest)
@keen oyster
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.
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
ohhhh
thanks!
Ok so, since this is the third time typing this out
battle function in my textbased rpg isnt functioning as intended, it should be allowing a change of between enemies and player dealing damage to eachother, instead it just deals damage to the player infinitely and never lets the player take turns nor exchange turns!!
This is my second month of Python, I'm doing it for school, so ik my code will prob not be the best, so please point out anything you see wrong even if its not gotta do with my issue here!
Hey
Line 188 is the culprit: ```py
currentTurn = totalEncounter[0][3]
totalEncounter[0][3] holds something about the enemy and since you're never changing it it's eternally the enemy's turn
line 234 and 235 though?
finalOrder.pop(3)
finalOrder.insert(0, current)
ohhhhh wait
I get what you mean now
tysm!
no problem
!close
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.