Thursday, May 10, 2012

Bikin game pake Vb nyok!!

Private Sub Command1_Click()
a = Option1
b = Option2
c = Option3

If a = True Then
    a = vbRed
    End If
If b = True Then                                                         
    b = vbGreen
    End If
If c = True Then
    c = vbBlue
    End If
   
If Label3.BackColor = a Then
    Timer1.Enabled = False
    Label4.Visible = False
    Label5.Visible = False
ElseIf Label4.BackColor = b Then
    Timer2.Enabled = False
    Label5.Visible = False
    Label3.Visible = False
ElseIf Label5.BackColor = c Then
    Timer3.Enabled = False
    Label3.Visible = False
    Label4.Visible = False
Else: MsgBox "Anda Kurang beruntung", 0, "coba lagi"
        Timer1.Enabled = True
        Timer2.Enabled = True
        Timer3.Enabled = True
    End If
   
    If Timer1.Enabled = False Or Timer2.Enabled = False Or Timer3.Enabled = False Then
    MsgBox "Jakpot", 0, "Selamat"
    End If
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Command3_Click()
Timer1.Enabled = True
Timer2.Enabled = True
Timer3.Enabled = True
Label3.Visible = True
Label4.Visible = True
Label5.Visible = True
End Sub

Private Sub Form_Load()
Shape1.FillColor = vbRed
Shape1.FillStyle = 0
Shape2.FillColor = vbGreen
Shape2.FillStyle = 0
Shape3.FillColor = vbBlue
Shape3.FillStyle = 0
Command1.Caption = "Oke"
Command2.Caption = "End"
Command3.Caption = "Coba Lagi"
End Sub

Private Sub Timer1_Timer()
warna = Int((Rnd) * 3)
If warna = 1 Then
Label3.BackColor = vbRed
ElseIf warna = 2 Then
Label3.BackColor = vbGreen
Else: Label4.BackColor = vbBlue
End If
End Sub

Private Sub Timer2_Timer()
warna = Int((Rnd) * 3)
If warna = 1 Then
Label4.BackColor = vbRed
ElseIf warna = 2 Then
Label4.BackColor = vbGreen
Else: Label4.BackColor = vbBlue
End If
End Sub

Private Sub Timer3_Timer()
warna = Int((Rnd) * 3)
If warna = 1 Then
Label5.BackColor = vbRed
ElseIf warna = 2 Then
Label5.BackColor = vbGreen
Else: Label5.BackColor = vbBlue
End If
End Sub

Mari Belajar Phython

 loop=1
o=0
def k():
    print('Menghitung Pombensin')
b=input('Panjang Jalan:')
c=input('Masukan Jarak:')
print
z=0
while z<b:
    z=z+c
    print('Letak Pom berada pada KM: ',z)
p=b/c
print ('Jumlah Pom sebanyak: ',p)

while loop==1:
    print
    o=input('mau input data lagi(y,n)?')
    if o==1:
        k()
    else:
        quit([])

 loop =1
pil =0
def a():
    b=input('masukan jumlah barang: ')
    b<100
    tb=b*10000
    print('Total bayar:',tb)
    return
def b():
    c=input('masukan jumlah barang: ')
    c>=100 and c<150
    tc=c*5000
    print ('total bayar:',tc)
    return
def c():
    d=input('masukan jumlah barang: ')
    d>=150
    td=d*2500
    print ('total bayar:',td)
    return
while loop==1:
    print
    print "Menu"
    print "1.Belanjaan kurang dari 100"
    print "2.Belanjaan diatas 100 dan kurang dari 150"
    print "3.Belanjaan diatas 150"
    pil=input('Pilihan Anda : ')
    if pil==1:
        print
        a()
    elif pil==2:
        print
        b()
    elif pil==3:
        print
        c()
    else:
        quit([])

Program Perpangkatan
loop =1
z=0
def a():
    print
    a=input('masukan angka:')
    b=input('Banyak deretan:')
    q=0
    while q<b:
        q=q+a
        print (q)
        print ('Pangkat 2 dari angka tersebut:',q*q)
        print ('Pangkat 3 dari angka tersebut:',q*q*q)
    return
while loop==1:
    print
    print('1.Input Angka')
    print('2.Keluar')
    z=input('Pilihan:')
    if z==1:
        a()
    else:
        print('good bye')
        quit([])

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes