-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
204 lines (176 loc) · 5.83 KB
/
Form1.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Furnica
{
public partial class Form1 : Form
{
char[] array = new char[1000];
int clicks = 0;
int x1 = 0;
int x2 = 0;
int y1 = 0;
int y2 = 0;
int whatever = 800;
int index = 0;
public Form1()
{
InitializeComponent();
}
private void Panel1_Paint(object sender, PaintEventArgs e)
{
Pen blackPen = new Pen(Color.Black, 1);
SolidBrush sb = new SolidBrush(Color.Red);
Graphics g = panel1.CreateGraphics();
g.DrawLine(blackPen, 0, 0, 0, 800);
g.DrawLine(blackPen, 0, 0, 800, 0);
g.DrawLine(blackPen, 800, 800, 0, 800);
g.DrawLine(blackPen, 800, 800, 800, 0);
for (int j=0;j<=20;j++)
{
g.DrawLine(blackPen, y1, y2, y1, 800);y1 = y1 + 40;
}
y1 = 0;
y2 = 0;
x1 = 0;
x2 = 0;
for (int h = 0; h <= 20; h++)
{
g.DrawLine(blackPen, x1, y1, 800, y1); y1 = y1 + 40;
}
y1 = 800;
y2 = 0;
x1 = 0;
x2 = 0;
}
private void Button1_Click(object sender, EventArgs e)
{
Pen blackPen = new Pen(Color.Red, 6);
SolidBrush sb = new SolidBrush(Color.Red);
Graphics g = panel1.CreateGraphics();
if (clicks==0)
{g.DrawLine(blackPen, x1, y1, x1, y1-40); y1 = y1 - 40; ; goto end; }
end:
Console.WriteLine("a");
array[index] = 'U';
label2.Text = Convert.ToString(array);
index++;
}
private void Button2_Click(object sender, EventArgs e)
{
Pen blackPen = new Pen(Color.Red, 6);
SolidBrush sb = new SolidBrush(Color.Red);
Graphics g = panel1.CreateGraphics();
if (clicks == 0)
{ g.DrawLine(blackPen, x1, y1, x1+40, y1); x1 = x1 + 40; ; goto end; }
end:
Console.WriteLine("a");
array[index] = 'R';
label2.Text = Convert.ToString(array);
index++;
}
private void Button3_Click(object sender, EventArgs e)
{
Pen blackPen = new Pen(Color.Red, 6);
SolidBrush sb = new SolidBrush(Color.Red);
Graphics g = panel1.CreateGraphics();
if (clicks == 0)
{ g.DrawLine(blackPen, x1, y1, x1, y1+40); y1 = y1 + 40; ; goto end; }
end:
Console.WriteLine("a");
array[index] = 'J';
label2.Text = Convert.ToString(array);
index++;
}
private void Button4_Click(object sender, EventArgs e)
{
Pen blackPen = new Pen(Color.Red, 6);
SolidBrush sb = new SolidBrush(Color.Red);
Graphics g = panel1.CreateGraphics();
if (clicks == 0)
{ g.DrawLine(blackPen, x1, y1, x1-40, y1); x1 = x1 - 40; ; goto end; }
end:
Console.WriteLine("a");
array[index] = 'L';
label2.Text = Convert.ToString(array);
index++;
}
private void Button5_Click(object sender, EventArgs e)
{
for (int i=0;i<=index;i++)
{
System.Threading.Thread.Sleep(200);
if (array[index] == 'J') { button3.PerformClick(); }
if (array[index] == 'U') { button1.PerformClick(); }
if (array[index] == 'R') { button2.PerformClick(); }
if (array[index] == 'L') { button4.PerformClick(); }
}
}
private void Button6_Click(object sender, EventArgs e)
{
y1 = 0;
y2 = 0;
x1 = 0;
x2 = 0;
panel1.Invalidate();
clicks = 0;
Label3_Click(sender, e);
x1 = 0;
x2 = 0;
y1 = 800;
y2 = 0;
index = 0;
}
private void Button7_Click(object sender, EventArgs e)
{
y1 = 0;
y2 = 0;
x1 = 0;
x2 = 0;
panel1.Invalidate();
clicks = 0;
Label3_Click(sender, e);
x1 = 0;
x2 = 0;
y1 = 800;
y2 = 0;
index = 0;
label2.Text = Convert.ToString('\0');
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Label3_Click(object sender, EventArgs e)
{
Pen blackPen = new Pen(Color.Black, 1);
SolidBrush sb = new SolidBrush(Color.Red);
Graphics g = panel1.CreateGraphics();
g.DrawLine(blackPen, 0, 0, 0, 800);
g.DrawLine(blackPen, 0, 0, 800, 0);
g.DrawLine(blackPen, 800, 800, 0, 800);
g.DrawLine(blackPen, 800, 800, 800, 0);
for (int j = 0; j <= 20; j++)
{
g.DrawLine(blackPen, y1, y2, y1, 800); y1 = y1 + 40;
}
y1 = 0;
y2 = 0;
x1 = 0;
x2 = 0;
for (int h = 0; h <= 20; h++)
{
g.DrawLine(blackPen, x1, y1, 800, y1); y1 = y1 + 40;
}
y1 = 800;
y2 = 0;
x1 = 0;
x2 = 0;
}
}
}