-
Notifications
You must be signed in to change notification settings - Fork 0
/
border.cs
50 lines (41 loc) · 1.42 KB
/
border.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
47
48
49
50
using System;
namespace GameBox
{
class Border
{
public void border_print(int mapx, int mapy)
{
string border_top_left = "╔";
string border_top = "═";
string border_top_right = "╗";
string border_bottom_left = "╚";
string border_bottom = "═";
string border_bottom_right = "╝";
string border_vertical = "║";
Console.CursorVisible = false;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.SetCursorPosition(0, 0);
Console.Write(border_top_left);
for (int cx = 0; cx <= mapx - 1; cx++)
{
Console.Write(border_top);
}
Console.WriteLine(border_top_right);
for (int cy = 0; cy <= mapy - 1; cy++)
{
Console.SetCursorPosition(0, cy + 1);
Console.Write(border_vertical);
Console.SetCursorPosition(mapx + 1, cy + 1);
Console.WriteLine(border_vertical);
}
Console.Write(border_bottom_left);
for (int cx = 0; cx <= mapx - 1; cx++)
{
Console.Write(border_bottom);
}
Console.WriteLine(border_bottom_right);
Console.SetCursorPosition(1, 1);
Console.ForegroundColor = ConsoleColor.White;
}
}
}