When working on my adventure game (Link: https://replit.com/@IsaacIsAwesome/StudiousReflectingConditional?v=1) I noticed that sometimes the cursor would return to the beginning of the line for no reason when printing something. It only occurs for some print statements which made me confused.
To replicate the bug, follow these steps:
- Hit Run.
- Enter “2” to access the Pack.
- Enter “3” or “4” to consume an Antidote and cure the player’s Poison.
At this point, you’ll notice that the screen displays this:
Poison! sted an Antidote and were cured of your
I think this occurs because this is printed to the console first:
You ingested an Antidote and were cured of your
And then a carriage return happens for some reason and overwrites the beginning part:
Poison! sted an Antidote and were cured of your
If someone knows why this is happening, I greatly appreciate it. Thanks for taking the time to read this!