C# - Stage #VQ0 (History - Down-arrow navigation)

Hello,

Excuse me for duplicating the topic - I didn’t know how to restore the previous one, but I’ve actually hit the issue here, hoping you could help solving it.

My code could be found here.

locally seems it works as expected though (previous command came up by pressing UP arrow)

Thanks!

Hey @inner, I tried commenting out ClearCurrentLine():

That improved things a bit:

Looks like overwriting with spaces isn’t fast enough. Our tester could catch the empty line mid-clear:

Let me know if you’d like further assistance!

Thanks. I will re-think this!

2 Likes

I had this same exact issue when trying to pass that stage with C#. It took a lot of trial and error to get past it. What I found was that Console.SetCursorPosition doesn’t play well with the tester. Any code that I had that used that was doomed to fail. To clear existing text from the screen I had to write a series of “\b \b” to the screen, which is a backspace-space-backspace combination.

Console.Write("\b \b");

While the code is ugly, it passes the tests. Good Luck!

2 Likes

Yep - fixed using this one:

Console.Write("\b \b");

Thanks!

1 Like