Advertisement
Larik

Untitled

May 12th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.  
  3.     Dim q As Integer
  4.     Dim w As Integer
  5.     Dim r As Integer
  6.  
  7.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  8.  
  9.         If w = 0 Then
  10.  
  11.             Button2.BackColor = Color.Green
  12.  
  13.             Button2.Text = "Стоп"
  14.  
  15.             Button1.Top = 12
  16.             Button1.Left = 12
  17.  
  18.             Button1.Text = "0"
  19.  
  20.             Button1.BackColor = Color.White
  21.  
  22.             q = 0
  23.  
  24.             r = 0
  25.  
  26.             Timer1.Start()
  27.  
  28.             w = 1
  29.  
  30.         Else
  31.  
  32.             Button2.BackColor = Color.White
  33.  
  34.             Button2.Text = "Старт"
  35.  
  36.             Button1.Top = 69
  37.             Button1.Left = 69
  38.  
  39.             Button1.BackColor = Color.White
  40.  
  41.             Button1.Text = ""
  42.  
  43.             q = 0
  44.  
  45.             r = 0
  46.  
  47.             Timer1.Stop()
  48.  
  49.             w = 0
  50.  
  51.         End If
  52.  
  53.     End Sub
  54.  
  55.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  56.  
  57.         If q = 0 Then
  58.  
  59.             If Button1.Top = 12 Then
  60.  
  61.                 If Button1.Left < 127 Then
  62.  
  63.                     Button1.Left = Button1.Left + 10
  64.  
  65.                 End If
  66.  
  67.             End If
  68.  
  69.             If Button1.Left > 127 Then Button1.Left = 127
  70.  
  71.             Button1.BackColor = Color.White
  72.  
  73.             Button1.Text = "0"
  74.  
  75.             If Button1.Top = 12 And Button1.Left = 127 Then
  76.  
  77.                 Button1.Text = "1"
  78.  
  79.                 Button1.BackColor = Color.Red
  80.  
  81.                 q = q + 1
  82.  
  83.             End If
  84.  
  85.         End If
  86.  
  87.  
  88.  
  89.         If q = 1 Then
  90.  
  91.             If Button1.BackColor = Color.Red Then
  92.  
  93.                 If Button1.Top < 127 And Button1.Left > 12 Then
  94.  
  95.                     Button1.Top = Button1.Top + 10
  96.                     Button1.Left = Button1.Left - 10
  97.                    
  98.                 End If
  99.  
  100.                 If Button1.Top > 127 And Button1.Left < 12 Then
  101.  
  102.                     Button1.Top = 127
  103.                     Button1.Left = 12
  104.  
  105.                 End If
  106.  
  107.             End If
  108.  
  109.             If Button1.Top = 127 And Button1.Left = 12 Then
  110.  
  111.                 Button1.Text = "2"
  112.  
  113.                 Button1.BackColor = Color.Orange
  114.  
  115.                 q = q + 1
  116.  
  117.             End If
  118.  
  119.         End If
  120.  
  121.  
  122.  
  123.         If q = 2 Then
  124.  
  125.             If Button1.BackColor = Color.Orange Then
  126.  
  127.                 If Button1.Top > 12 And Button1.Left < 127 Then
  128.  
  129.                     Button1.Top = Button1.Top - 10
  130.                     Button1.Left = Button1.Left + 10
  131.  
  132.                 End If
  133.  
  134.                 If Button1.Top < 12 And Button1.Left > 127 Then
  135.  
  136.                     Button1.Top = 12
  137.                     Button1.Left = 127
  138.  
  139.                 End If
  140.  
  141.             End If
  142.  
  143.             If Button1.Top = 12 And Button1.Left = 127 Then
  144.  
  145.                 Button1.Text = "3"
  146.  
  147.                 Button1.BackColor = Color.Yellow
  148.  
  149.                 q = q + 1
  150.  
  151.             End If
  152.  
  153.         End If
  154.  
  155.  
  156.  
  157.         If q = 3 Then
  158.  
  159.             If Button1.Left = 127 Then
  160.  
  161.                 If Button1.Top < 127 Then
  162.  
  163.                     Button1.Top = Button1.Top + 10
  164.  
  165.                 End If
  166.  
  167.             End If
  168.  
  169.             If Button1.Top > 127 Then Button1.Top = 127
  170.  
  171.             If Button1.Top = 127 And Button1.Left = 127 Then
  172.  
  173.                 Button1.Text = "4"
  174.  
  175.                 Button1.BackColor = Color.Green
  176.  
  177.                 q = q + 1
  178.  
  179.             End If
  180.  
  181.         End If
  182.  
  183.  
  184.  
  185.         If q = 4 Then
  186.  
  187.             If Button1.BackColor = Color.Green Then
  188.  
  189.                 If Button1.Top > 12 And Button1.Left > 12 Then
  190.  
  191.                     Button1.Top = Button1.Top - 10
  192.                     Button1.Left = Button1.Left - 10
  193.  
  194.                 End If
  195.  
  196.                 If Button1.Top < 12 And Button1.Left < 12 Then
  197.  
  198.                     Button1.Top = 12
  199.                     Button1.Left = 12
  200.  
  201.                 End If
  202.  
  203.             End If
  204.  
  205.             If Button1.Top = 12 And Button1.Left = 12 Then
  206.  
  207.                 Button1.Text = "5"
  208.  
  209.                 Button1.BackColor = Color.Blue
  210.  
  211.                 q = q + 1
  212.  
  213.             End If
  214.  
  215.         End If
  216.  
  217.  
  218.  
  219.         If q = 5 Then
  220.  
  221.             If Button1.BackColor = Color.Blue Then
  222.  
  223.                 If Button1.Top < 127 And Button1.Left < 127 Then
  224.  
  225.                     Button1.Top = Button1.Top + 10
  226.                     Button1.Left = Button1.Left + 10
  227.  
  228.                 End If
  229.  
  230.                 If Button1.Top > 127 And Button1.Left > 127 Then
  231.  
  232.                     Button1.Top = 127
  233.                     Button1.Left = 127
  234.  
  235.                 End If
  236.  
  237.             End If
  238.  
  239.             If Button1.Top = 127 And Button1.Left = 127 Then
  240.  
  241.                 Button1.Text = "6"
  242.  
  243.                 Button1.BackColor = Color.DarkBlue
  244.  
  245.                 q = q + 1
  246.  
  247.             End If
  248.  
  249.         End If
  250.  
  251.  
  252.  
  253.         If q = 6 Then
  254.  
  255.             If Button1.Top = 127 Then
  256.  
  257.                 If Button1.Left > 12 Then
  258.  
  259.                     Button1.Left = Button1.Left - 10
  260.  
  261.                 End If
  262.  
  263.             End If
  264.  
  265.             If Button1.Left < 12 Then Button1.Left = 12
  266.  
  267.             If Button1.Top = 127 And Button1.Left = 12 Then
  268.  
  269.                 Button1.Text = "7"
  270.  
  271.                 Button1.BackColor = Color.Purple
  272.  
  273.                 q = q + 1
  274.  
  275.             End If
  276.  
  277.         End If
  278.  
  279.  
  280.  
  281.         If q = 7 Then
  282.  
  283.             If Button1.BackColor = Color.Purple Then
  284.  
  285.                 If Button1.Top > 12 And Button1.Left < 127 Then
  286.  
  287.                     Button1.Top = Button1.Top - 10
  288.                     Button1.Left = Button1.Left + 10
  289.  
  290.                 End If
  291.  
  292.                 If Button1.Top < 12 And Button1.Left > 127 Then
  293.  
  294.                     Button1.Top = 12
  295.                     Button1.Left = 127
  296.  
  297.                 End If
  298.  
  299.             End If
  300.  
  301.             If Button1.Top = 12 And Button1.Left = 127 Then
  302.  
  303.                 Button1.Text = "8"
  304.  
  305.                 Button1.BackColor = Color.DarkBlue
  306.  
  307.                 q = q + 1
  308.  
  309.             End If
  310.  
  311.         End If
  312.  
  313.  
  314.  
  315.         If q = 8 Then
  316.  
  317.             If Button1.BackColor = Color.DarkBlue Then
  318.  
  319.                 If Button1.Top < 127 And Button1.Left > 12 Then
  320.  
  321.                     Button1.Top = Button1.Top + 10
  322.                     Button1.Left = Button1.Left - 10
  323.  
  324.                 End If
  325.  
  326.                 If Button1.Top > 127 And Button1.Left < 12 Then
  327.  
  328.                     Button1.Top = 127
  329.                     Button1.Left = 12
  330.  
  331.                 End If
  332.  
  333.             End If
  334.  
  335.             If Button1.Top = 127 And Button1.Left = 12 Then
  336.  
  337.                 Button1.Text = "9"
  338.  
  339.                 Button1.BackColor = Color.Green
  340.  
  341.                 q = q + 1
  342.  
  343.             End If
  344.  
  345.         End If
  346.  
  347.  
  348.  
  349.         If q = 9 Then
  350.  
  351.             If Button1.Left = 12 Then
  352.  
  353.                 If Button1.Top > 12 Then
  354.  
  355.                     Button1.Top = Button1.Top - 10
  356.  
  357.                 End If
  358.  
  359.             End If
  360.  
  361.             If Button1.Top < 12 Then Button1.Top = 12
  362.  
  363.             If Button1.Top = 12 And Button1.Left = 12 Then
  364.  
  365.                 Button1.Text = "10"
  366.  
  367.                 Button1.BackColor = Color.Yellow
  368.  
  369.                 q = q + 1
  370.  
  371.             End If
  372.  
  373.         End If
  374.  
  375.  
  376.  
  377.         If q = 10 Then
  378.  
  379.             If Button1.BackColor = Color.Yellow Then
  380.  
  381.                 If Button1.Top < 127 And Button1.Left < 127 Then
  382.  
  383.                     Button1.Top = Button1.Top + 10
  384.                     Button1.Left = Button1.Left + 10
  385.  
  386.                 End If
  387.  
  388.                 If Button1.Top > 127 And Button1.Left > 127 Then
  389.  
  390.                     Button1.Top = 127
  391.                     Button1.Left = 127
  392.  
  393.                 End If
  394.  
  395.             End If
  396.  
  397.             If Button1.Top = 127 And Button1.Left = 127 Then
  398.  
  399.                 Button1.Text = "11"
  400.  
  401.                 Button1.BackColor = Color.Orange
  402.  
  403.                 q = q + 1
  404.  
  405.             End If
  406.  
  407.         End If
  408.  
  409.  
  410.  
  411.         If q = 11 Then
  412.  
  413.             If Button1.BackColor = Color.Orange Then
  414.  
  415.                 If Button1.Top > 12 And Button1.Left > 12 Then
  416.  
  417.                     Button1.Top = Button1.Top - 10
  418.                     Button1.Left = Button1.Left - 10
  419.  
  420.                 End If
  421.  
  422.                 If Button1.Top < 12 And Button1.Left < 12 Then
  423.  
  424.                     Button1.Top = 12
  425.                     Button1.Left = 12
  426.  
  427.                 End If
  428.  
  429.             End If
  430.  
  431.             If Button1.Top = 12 And Button1.Left = 12 Then
  432.  
  433.                 Button1.Text = "12"
  434.  
  435.                 Button1.BackColor = Color.Red
  436.  
  437.                 q = 0
  438.  
  439.                 r = r + 1
  440.  
  441.                 MsgBox(r)
  442.  
  443.             End If
  444.  
  445.         End If
  446.  
  447.     End Sub
  448.  
  449. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement