Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
How can i write code in c# console so that I can move a character within a circle.
Posted
Comments
bbirajdar 8-Oct-12 10:52am    
You can write the code using Visual Studio IDE or a simple notepad too..Whatever you are comfortable with...The only other thing required is a C# compiler and .NET framework installed on the machine.
Sergey Alexandrovich Kryukov 8-Oct-12 15:27pm    
It needs just one trick to use -- please see my answer.
--SA
Sergey Alexandrovich Kryukov 8-Oct-12 15:17pm    
This is not a valid question, because we cannot know hot can you write it. For example, I know how I can do it, but I would not even try to waste my time on this pointless exercise. Perhaps some will volunteer to help you more if you explain the purpose. And anyway, it cannot be perfect circle, because the aspect ratio will always depend on console setting, such as fonts and size.
--SA

1 solution

Use System.Console.SetCursorPosition to move your cursor over already written text, to overwrite it and change the position of your character:
http://msdn.microsoft.com/en-us/library/system.console.setcursorposition.aspx[^].

—SA
 
Share this answer
 
v2
Comments
[no name] 8-Oct-12 15:47pm    
Yes
Sergey Alexandrovich Kryukov 8-Oct-12 15:52pm    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900