vb 6 code the lucky 7 game
DESCRIPTION
Source Code VB 6 Membuat Game Lucky 7TRANSCRIPT
![Page 1: VB 6 Code the Lucky 7 Game](https://reader036.vdocuments.pub/reader036/viewer/2022082614/5695d31c1a28ab9b029cdbba/html5/thumbnails/1.jpg)
VB 6.0 GAME PROJECT by Arie Musbandi
The Lucky 7
Membuat game sederhana dimana ditampilkan 3 angka secara acak, jika muncul angka 7 maka dianggap beruntung, tampilan form nya sebagai berikut :
Property SetForm1 BorderStyle
Caption1-Fixed SingleLucky 7
Label1, Label2, Label3 AlignmentBorderStyleCaptionFont
2-Center1-Fixed Single0Font Style= Bold; Size =72
Label 4 AlignmentBorderStyleCaptionFont
2-Center1-Fixed SingleLet’s PlaySize = 24
Command1 Caption Round
VB Code :Private Sub Command1_Click()Dim A, B, C As IntegerDim Luck As IntegerLuck = 0A = CInt(Rnd() * 9)B = CInt(Rnd() * 9)C = CInt(Rnd() * 9)Label1.Caption = ALabel2.Caption = BLabel3.Caption = C
If A = 7 Then Luck = Luck + 1 Label1.BackColor = vbYellowElse Label1.BackColor = &H80000005End If
If B = 7 Then Luck = Luck + 1 Label2.BackColor = vbYellowElse Label2.BackColor = &H80000005End If
If C = 7 Then Luck = Luck + 1 Label3.BackColor = vbYellowElse Label3.BackColor = &H80000005End If
If Luck > 0 Then Label4.Caption = "YOU WIN!" & vbCrLf & Luck & " Good Luck!"Else Label4.Caption = "YOU LOST! Bad Luck!"End IfEnd Sub
Label1
Label2
Label3
Label4
Command1
Form1
![Page 2: VB 6 Code the Lucky 7 Game](https://reader036.vdocuments.pub/reader036/viewer/2022082614/5695d31c1a28ab9b029cdbba/html5/thumbnails/2.jpg)