Kivy İle Taş Kağıt Makas
Python
bu Kodu yazarken baya Eğlendim oynarkende Eğlenceli sizde bir kivy editor indirip oynayın resimler kodlar from kivy.app import App from kivy.uix.label imp
bu Kodu yazarken baya Eğlendim oynarkende Eğlenceli sizde bir kivy editor indirip oynayın
resimler
kodlar
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
from random import choice
class content(GridLayout):
def play(self,btn):
self.pcchoice=choice(["Taş","Kağıt","Makas"])
self.choice=self.entry.text
if self.choice=="Taş":
if self.pcchoice=="Taş":
self.text2.text=f"Berabere {self.pcchoice}"
elif self.pcchoice=="Kağıt":
self.text2.text=f"Kaybettin {self.pcchoice}"
elif self.pcchoice=="Makas":
self.text2.text=f"Kazandın {self.pcchoice}"
elif self.choice=="Kağıt":
if self.pcchoice=="Taş":
self.text2.text=f"Kazandın {self.pcchoice}"
elif self.pcchoice=="Kağıt":
self.text2.text=f"Berabere {self.pcchoice}"
elif self.pcchoice=="Makas":
self.text2.text=f"Kaybettin {self.pcchoice}"
elif self.choice=="Makas":
if self.pcchoice=="Taş":
self.text2.text=f"Kaybettin {self.pcchoice}"
elif self.pcchoice=="Kağıt":
self.text2.text=f"Kazandın {self.pcchoice}"
elif self.pcchoice=="Makas":
self.text2.text=f"Berabere {self.pcchoice}"
def widgets(self):
self.text1=Label(text="Taş Kağıt ve Makas")
self.text2=Label(text="")
self.entry=TextInput(multiline=False)
self.button1=Button(text="Play")
self.button1.bind(on_press=self.play)
for widget in [self.button1,self.entry,self.text1,self.text2]:
self.add_widget(widget)
def __init__(self):
super().__init__()
self.cols=2
self.title="Taş Kağıt ve Makas"
self.widgets()
class main(App):
def build(self):
self.title="rockPaper"
return content()
if __name__ == '__main__':
main=main()
main.run()
Share Your Expertise, Earn Rewards!
Found this insightful? Imagine your knowledge generating income. Contribute your articles to bylge.com and connect with readers while unlocking your earning potential.