Urgent Issues with Running Replit Code

Hi everyone. I recently noticed, when working with my coding project (which I will be presenting at the science fair, which is in 2 days), that there are some unexplainable glitches.

The situation is this: I need people to be able to access the project from their own devices, since I will not actually be at the science fair at the day of the fair.

Therefore, I created a new account, which I would share the username and password for on my trifold paper so people didn’t have to create a new account, forked my project, and tested to see how it worked when forked.

It was a complete failure. My project is a text-based Python game, and it has a few stages:

  • Main Menu: User decides an option between 1. Single player, 2. Local Multiplayer. . . etc.
  • Character Choice: The user decides a fighting character to use for the game
  • Battle: The user and computer (or user and other user) battle in turn-based combat, similar to “Pokemon” RPG battle mechanics

The issue occurs during the “Battle” sequence. Even though my code (double checked) says to have user input for which “battle move” they would like to use, the user input does not appear in the console for no apparent reason.

However, when I run the original project on my original mainsite account (@CCodes), the issue does not happen, even though I have not altered any of the code.

Forked project link: https://replit.com/@CCodesSTEAM/Super-Smash-Dogs-v132-lessgreater-STEAM-Fair-Version

Original project link: https://replit.com/@CCodes/Super-Smash-Dogs-v132

If you have any other ideas with how to share my project, please let me know.

1 Like

That is so weird. The input is under the area I can scroll to. But if I click the console and type something, it’ll scroll to the bottom.
That could be a workaround, I guess. But this is definitely a bug.

Can you clarify the problem? I forked the forked project and was able to play it fine. Is the problem that the user must scroll down in the console, and scrolling doesn’t happen automatically?

The problem is that the user needs to scroll down, but they can’t. (I mean, I think that’s the issue)

And I just tried to get a video of the problem and it has magically fixed itself! (I’m still using the same Repl)

1 Like

I experimented with a test case and I have some theories and observations (though I still haven’t experienced that problem):

The console has a scroll bar and also needs to remember what line is at the bottom. If the scroll is at the bottom, new output will make it scroll down. If it is near the top, the scroll will not change. Clearing the console output has effects on this and may mess things up. Sometimes, there is even a mismatch between the scrollbar and the bottom line, because the user typed into the console snapping it down. A bunch of random stuff I don’t really understand. The behavior is inconsistent between runs and depends on using the Trash can to clear the console and using os.system("clear").

Clearing at least one run from the console while the program is running.
Starting from a blank console.
These cases had different behavior when I tested.

Hmm, is the user unable to scroll down to just the input prompt line, or are they completely stuck at the top of the output?

It automatically scrolls down like normal, but stops a bit before the input. Then, it’s possible to scroll up again, but not down.

1 Like

Just to clarify, @QwertyQwerty88 is right about the problem. I’m not sure why it won’t scroll down to the input part. . .

Hmm, it seems to have fixed itself now once I have logged in today. Do you guys think it was somehow a code error or a Replit system error that caused this issue?

According to my observations:
This is caused by a mismatch between the lowest possible position of the scrollbar, and the lowest line. The mismatch is caused by clearing the console with os.system("clear") after using input(). And this must happen when the console output is long enough to necessitate a scrollbar.
When that happens, the clearing of the console probably messes up the scrollbar position, and also it stops scrolling down automatically. The mismatch makes it so that what the scrollbar thinks is the bottom of the output doesn’t include the input() prompt line.
If a user types in an input in the situation, the console is forced to show the input() line, snapping down to the actual bottom. However, there is another bug where the snapping down due to user input does not affect the scrollbar’s stored position, so if you then start to scroll, it will go back to the scrollbar’s original position instead of being near the input() line.

The working fix I observed was to put a print() anywhere between the input() and clear(), so that they would not be right next to each other. (However, it still will not scroll down automatically.)

Also, all of these errors might be inconsistent between runs, depending on run history and stuff.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.