forked from NataSola/HelloCode
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (36 loc) · 822 Bytes
/
Copy pathProgram.cs
File metadata and controls
47 lines (36 loc) · 822 Bytes
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
Console.Clear();
//Console.SetCursorPosition(10, 4);
//Console.WriteLine("+");
int xa = 40, ya = 1,
xb = 1, yb = 30,
xc = 80, yc = 30;
Console.SetCursorPosition(xa, ya);
Console.WriteLine("+");
Console.SetCursorPosition(xb, yb);
Console.WriteLine("+");
Console.SetCursorPosition(xc, yc);
Console.WriteLine("+");
int x = xa, y = xb;
int count = 0;
while (count < 10000)
{
int what = new Random().Next(0, 3); // [0;3) 0 1 2
if (what == 0)
{
x = (x + xa) / 2;
y = (y + ya) / 2;
}
if (what == 1)
{
x = (x + xb) / 2;
y = (y + yb) / 2;
}
if (what == 2)
{
x = (x + xc) / 2;
y = (y + yc) / 2;
}
Console.SetCursorPosition(x, y);
Console.WriteLine("+");
count++;
}