public static void Main()
Random rnd = new Random();
int w = Polygon.GetClientWidth();
int h = Polygon.GetClientHeight();
Point yBottom = new Point(0, -h / 2);
Point yTop = new Point(0, h / 2);
Polygon yAxis = new Polygon(yBottom, yTop);
Point xLeft = new Point(-w / 2, 0);
Point xRight = new Point(w / 2, 0);
Polygon xAxis = new Polygon(xLeft, xRight);
Console.WriteLine("m= {0}, b= {1}, x= {2}", m, b, x);
Point A = new Point(-w / 2, m * -w / 2 + b);
Point B = new Point(w / 2, m * w / 2 + b);
Point M = new Point(x, y);
Polygon pM = new Polygon(20, 3);
Polygon lineCaption = new Polygon(10, 0);
lineCaption.Move(-w / 2 + 100, h / 2 - 100);
lineCaption.SetCaption("Y = " + m + "X + " + b);
Polygon t = new Polygon(A, B);
Console.WriteLine("guess the Y number (x is {0})", x);
int guess = int.Parse(Console.ReadLine());
Console.WriteLine("try less");
Console.WriteLine("try more");
for (int i = 0; i < 3; i++)
pM.SetBrushColor(System.Drawing.Color.Red);
pM.SetBrushColor(System.Drawing.Color.White);
guess = int.Parse(Console.ReadLine());
Console.WriteLine("Correct!");
for (int i = 0; i < 5; i++)
pM.SetBrushColor(System.Drawing.Color.Green);
pM.SetBrushColor(System.Drawing.Color.White);