Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 Idon_tevenknow
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- bool flag = true;
- int pol = 427;
- int potolok1 = 70;
- private void button1_Click(object sender, EventArgs e)
- {
- timer1.Interval = 10;
- timer1.Start();
- //HB(3, 1, 2, 3);
- }
- public void HB(int n, int x, int y, int z)
- {
- if (n != 0)
- {
- HB(n - 1, x, z, y);
- listBox1.Items.Add($"{x} -> {y}");
- HB(n - 1, z, y, x);
- }
- }
- public void moving()
- {
- int potolok2 = (label6.Location.X - (label3.Width / 2));
- if (label3.Location.X == label3.Location.X && label3.Location.Y > potolok1 && flag) label3.Top -= 5;
- else if (label3.Location.Y == label3.Location.Y && label3.Location.X < potolok2)
- {
- label3.Left += 5;
- flag = false;
- }
- else if (label3.Location.X > potolok2 && label3.Bottom+(label3.Height+ label3.Height/2) < 427) label3.Top += 5;
- else textBox1.Text = label3.Location.X + " " + label3.Location.Y.ToString();
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- moving();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement