simple suit game in python

apakah ini benar game suit, entahlah karena belum dikoreksi :

import random

class orang:
    def jari(self):
        x = random.randint(1,3)
        return x

class game:
    print "1 Jempol"
    print "2 Telunjuk"
    print "3 Kelingking"
    
    ins = orang()
    x1 = ins.jari()
    
    ins2 = orang()
    x2 = ins.jari()
    
    ins3 = orang()
    x3 = ins.jari()
     
    if x1 >= x2:
        print ("Jempol menang")
    elif x1 == x1:
        print ("Ulang")
    elif x1 <= x3 :
        print ("Kelingkin menang")
    elif x2 >= x1 :
        print ("Jempol Menang")
    elif x2 == x2 :
        print ("Ulang")
    elif x2 <= x3 :
        print ("Telunjuk menang")
    elif x3 >= x1 :
        print ("Kelingking menang")
    elif x3 == x3 :
        print ("Ulang")
    elif x3 <= x2 :
        print ("Telunjuk menang")

x = game()

tunggu sampai dicocok baru kita tau apakah ini benar / tidak..:D
after dicocokkan

import random

class orang:
    def jari(self):
        x = random.randint(1,3)
        return x

class game:
    print "1 Jempol"
    print "2 Telunjuk"
    print "3 Kelingking"
    
    ins = orang()
    x1 = ins.jari()
    
    ins2 = orang()
    x2 = ins.jari()
    
     
    if x1 == 1 >= x2 == 2:
        print ("Jempol menang")
    elif x1 == 1 == x1 == 1:
        print ("Ulang")
    elif x1 == 1  <= x2 == 3 :
        print ("Kelingkin menang")
    elif x2 == 2 >= x1 == 1 :
        print ("Jempol Menang")
    elif x2 == 2 == x2 == 2 :
        print ("Ulang")
    elif x2 == 2 <= x1 == 3 :
        print ("Telunjuk menang")
    elif x1 == 3 >= x2 == 1 :
        print ("Kelingking menang")
    elif x1 == 3 == x2 == 3 :
        print ("Ulang")
    elif x1 == 3 <= x2 == 2 :
        print ("Telunjuk menang")
#kondisi=1
#while kondisi:
x = game()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s