Random movement of star on the screen
<p>i want to write a ' * ' to center of the screen and than it can move random to        rigth,left,up or down every 100 milisecond.if ' * ' is on the end of row it must be at   start of that row and if it is on the end of column it must be at start of that column(and also their reverse scenerio is valid).I wrote thats code but the problem is that i can't delete the old movement(so there are ' * ' for every movement)i solved it to put ' _ ' to its old movement.is there any other solution to make just one ' * ' on screen ? And also i can't delete the old movement if ' * ' is at the end of the row.Here is the source code : </p>

<pre><code>private static void MovementOfStar()
    {
        int row = 40, col = 12;
        Console.CursorVisible = false;
        Console.SetCursorPosition(row, col);

        int direction = 0;
        Random r = new Random();

        for (int i = 0; i &lt; 1000; i++)   // count of movement
        {
            Console.Write("*");
            System.Threading.Thread.Sleep(100);
            Console.Write('\b');
            Console.Write("_");



            direction = r.Next(5);
            while (direction== 0)
                direction = r.Next(5);

            switch (direction)
            {
                case 1:
                     if (row + 1 &gt;= 80)
                         row = 0;
                    Console.SetCursorPosition(row++, col);
                    break;
                case 2:
                    if (row - 1 &lt;= 0)
                        row=79;
                    Console.SetCursorPosition(row--, col);
                    break;
                case 3:
                    if (col + 1 &gt;= 25)
                        col = 0;
                    Console.SetCursorPosition(row, col++);
                    break;
                case 4:
                    if (col - 1 &lt;= 0)
                        col = 24;
                    Console.SetCursorPosition(row, col--);
                    break;
            }


        }
</code></pre>
