Skip to content

Commit cd693c7

Browse files
author
Araqelyan Tiran
committed
Add Show_1 and ShowEmpty methods
Show image view and empty image
1 parent 9be7b4f commit cd693c7

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

Animation/ConsoleAnimation/MatrixAnimation.cs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class MatrixAnimation
77
readonly char b = '*';
88
readonly int m = Console.CursorLeft;
99
readonly int n = Console.CursorTop;
10-
int y = 0;
11-
int z = 0;
10+
int y = 0;
11+
int z = 0;
1212
readonly char[,] A = new char[15, 100];
1313

1414
void View_1(char[,] c)
@@ -56,5 +56,36 @@ void View_2(char[,] c)
5656

5757
}
5858
}
59+
60+
void Show_1(object o)
61+
{
62+
63+
for (int i = 0; i < A.GetLength(0); i++)
64+
{
65+
for (int j = 0; j < A.GetLength(1); j++)
66+
{
67+
Console.ForegroundColor = ConsoleColor.Red;
68+
Console.Write(A[i, j]);
69+
}
70+
Console.WriteLine();
71+
}
72+
73+
Console.SetCursorPosition(m, n);
74+
}
75+
void ShowEmpty(char[,] c)
76+
{
77+
for (int i = 0; i < c.GetLength(0); i++)
78+
{
79+
for (int j = 0; j < c.GetLength(1); j++)
80+
{
81+
c[i, j] = ' ';
82+
83+
}
84+
Console.WriteLine();
85+
}
86+
87+
Console.SetCursorPosition(m, n);
88+
}
89+
5990
}
6091
}

0 commit comments

Comments
 (0)