Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

modifying anything to do with the buffer console results in error. PLSS HELP ME - C#

+3 votes
asked Apr 19, 2023 by Santos Garcia-Lara (150 points)
Hi guys! I am trying to make an on running a game. An example of this would the snake game or the dinosaur game. The thing is that every time I try to use the function to move the cursor of the console it results in an unhandled exception, some example of this is functions are SetCursorPosition(Int32, Int32), SetBufferHeight(), and SetBufferWidth(). I thought this gotta do with the buffer height and width which I end up using the function Console.WriteLine(Console.BufferWidth); & Console.WriteLine(Console.BufferHeight); This results in 0, 0. Please help me to find an alternative or solution.

1 Answer

0 votes
answered Apr 23, 2023 by Peter Minarik (88,520 points)
I've never tried to change the cursor position on the screen in C#, but my suspicion is that the issue could be that the code is run on a server and information is relayed to your browser.

Your code might even work on your local PC if not run on OnlineGDB. You can install Visual Studio, which has a free version (Community edition):  https://visualstudio.microsoft.com/
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.