For VB source program JiuCu wave tile loose points
Time:11-03
o source program please send 1551298227 @qq.com
CodePudding user response:
Option Explicit Dim A& B& C& D& Private Sub Command1_Click () A=Val (Text1 (0). The Text) B=Val (Text1 (1). The Text) C=Val (Text1 (2). The Text) D=Val (Text1 (3). The Text) Pour A, 0, 0 Pour2 A, 0, 0 End Sub Sub Pour (ByVal x& , ByVal y& , ByVal z&) 'cup pour: A, B cup, C cup, the last state List1. AddItem x & amp; "" & amp; Y & amp; "" & amp; Z If x And y=D=D Then List1. AddItem "mission accomplished!" The Else If x & gt; 0 And y=0 Then 'x - & gt; Y If x + y & gt; Then x=x + y - B: B=B y the Else y=y + x: x=0 Pour the x, y, z ElseIf y & gt; 0 And z & lt; Then C 'y - & gt; Z If y + z & gt; C Then y=y + z - C: z=C Else z=z + y: y=0 Pour the x, y, z ElseIf z & gt; 0 And x & lt; A Then 'z - & gt; X X=x + z: z=0 Pour the x, y, z End the If End the If End Sub Sub Pour2 (ByVal x& , ByVal y& , ByVal z&) 'cup pour: A, B cup, C cup, the last state List1. AddItem x & amp; "" & amp; Y & amp; "" & amp; Z If x And y=D=D Then List1. AddItem "mission accomplished!" The Else If x & gt; 0 And z=0 Then 'x - & gt; Z If x + z & gt; Then x=x + z - C: C=C Else z=z + z x: x=0 Pour2 x, y, z ElseIf z & gt; 0 And y & lt; B Then 'z - & gt; Y If y + z & gt; Then z=y + z - B: B=B y the Else y=y + z, z=0 Pour2 x, y, z ElseIf y & gt; 0 And x & lt; Then A 'y - & gt; X X=x + y, y=0 Pour2 x, y, z End the If End the If End Sub