-
Notifications
You must be signed in to change notification settings - Fork 0
/
Counter.cs
46 lines (39 loc) · 884 Bytes
/
Counter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using static asparagus.Game;
class Counter
{
private static string[] values = new string[10]{
"#### ## ## ####",
" # # # # #",
"### ##### ###",
"### #### ####",
"# ## #### # #",
"#### ### ####",
"#### #### ####",
"### # # # #",
"#### ##### ####",
"#### #### ####"
};
public static Pixel[] Counter1(int value, Color _color)
{
int number = value;
if (number < 0) { number = 0; }
if (number > 9) { number = 9; }
Pixel[] pixels = new Pixel[3 * 5];
for (var i = 0; i < pixels.Length; i++)
{
pixels[i].Char.UnicodeChar = ' ';
int color = ColorInt(TRANSPARENT, TRANSPARENT);
if (values[number][i] == '#')
{
color = ColorInt(_color.foreground, _color.background);
}
else
{
color = ColorInt(TRANSPARENT, TRANSPARENT);
}
pixels[i].Attributes = (short)color;
}
return pixels;
}
}