Author Topic: Console Animation C#  (Read 1548 times)

0 Members and 1 Guest are viewing this topic.

Offline etnelTopic starter

  • Contributor
  • Posts: 13
  • Country: se
Console Animation C#
« on: September 07, 2021, 04:04:49 pm »
Any ideas of how I would make a "Cube" bounce from the right->left->up->down in a loop. Similar to the "DVD-animation" but it does not need to bounce off random values. I would like the code as short as possible.

The "Cube" is a 3x3 of "#".
# # #
# # #
# # #
 

Offline etnelTopic starter

  • Contributor
  • Posts: 13
  • Country: se
Re: Console Animation C#
« Reply #1 on: September 07, 2021, 04:57:26 pm »
Code: [Select]
static void DrawTop(int space)
        {
            for (int i = 0; i < space; i++)
            {
                Console.WriteLine();
            }

            Console.Write("# # #");
            Console.WriteLine();
            Console.Write("# # #");
            Console.WriteLine();
            Console.Write("# # #");
        }
Added top to bottom. Pretty much figured out everything. If anyone sees a way to improve, please let me know.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf