'''
import random
class rps:
def __init__(self):
self.com = None
self.user = None
def setCnum(self,n):
print('[rps] setCnum()')
return random.randint(0, 2)
def setUnum(self,n,a):
print('Which object do you pick? (0=rock,1=scissors,2=paper)')
a=int(input(a))
if a!=0 and a!=1 and a!=2:
print("ERROR:THAT IS NOT AN OPTION")
self.setUnum(n,0)
return a
def startGame(self,n):
print('[rps] startGame()')
self.com = self.setCnum(n)
self.user = self.setUnum(n,0)
self.printResult()
def printResult(self):
global np
global up
print("Computer vs user :",end=" ")
if rps.com==0 :
print("rock vs",end=" ")
elif rps.com==1 :
print("scissors vs",end=" ")
elif rps.com==2 :
print("paper vs",end=" ")
if rps.user==0 :
print("rock >>",end=" ")
elif rps.user==1 :
print("scissors >>",end=" ")
elif rps.user==2 :
print("paper >>",end=" ")
if rps.com==rps.user:
print("Tie: both earns 1 point")
np=np+1
up=up+1
elif rps.com==0:
if rps.user==1:
print("Computer win: Computer wins 2 points")
np = np + 2
else:
print("User win: User wins 2 points")
up = up + 2
elif rps.com==1:
if rps.user==2:
print("Computer win: Computer wins 2 points")
np = np + 2
else:
print("User win: User wins 2 points")
up = up + 2
elif rps.com==2:
if rps.user==0:
print("Computer win: Computer wins 2 points")
np = np + 2
else:
print("User win: User wins 2 points")
up = up + 2
np=0
up=0
np=int(np)
up=int(up)
rps = rps()
print("please input the rounds")
n=int(input())
for i in range(n):
rps.startGame(n)
if np==up:
print("tie...")
print("what will you do?(1=penalties,0=agree on a tie)")
b=int(input())
if b==1:
rps.startGame(n)
if np == up:
print("tie...")
elif np < up:
print("user win!")
else:
print("computer win!")
elif np<up:
print("user win!")
else:
print("computer win!")
c언어 문법 + 자료구조 (완)
python 문법 (완)
1. python 라이브러리 활용 ( 그래프 그리기, pyqt5 GUI, pygame 게임만들기, 인공지능 이론, 인공지능 실습)
2. 유니티 ( 3D게임, 앱 제작, C# 언어 )
3. JAVA ( 2D GUI )
'''
#
# from tkinter import *
#
# root = Tk()
# label = Label(root, text='idk anymore')
# label.pack()
#
# root.mainloop()
# from tkinter import *
#
# root = Tk()
# listbox = Listbox(root)
# listbox.pack()
#
# for i in ['1', '2', '3', '4','5']:
# listbox.insert(END, i)
#
# root.mainloop()
# from tkinter import *
#
# root = Tk()
# entry = Entry(root)
# entry.pack()
# entry.insert(0, "你好世界")
# root.mainloop()
# from tkinter import *
#
# root = Tk()
# text = Text(root)
# text.pack()
#
# data = '''this is a notepad, write anything'''
#
# text.insert(1.0, data)
#
# root.mainloop()
# from tkinter import *
#
# root = Tk()
# b1 = Button(root, text="Kim jong un's secret nuke button \n(DO NOT PRESS)")
# b1.pack()
#
# def btn_click(event):
# print("congratulations, you have doomed the world.")
#
# b1.bind('<Button-1>', btn_click)
#
# root.mainloop()
# from tkinter import *
#
# root = Tk()
#
# listbox = Listbox(root)
# label = Label(root, text='제목')
# entry = Entry(root)
# text = Text(root)
# b1 = Button(root, text='생성')
# b2 = Button(root, text='수정')
# b3 = Button(root, text='삭제')
#
# listbox.grid(row=0, column=0, columnspan=3, sticky='ew')
# label.grid(row=1, column=0)
# entry.grid(row=1, column=1, columnspan=2, sticky='ew')
# text.grid(row=2, column=0, columnspan=3)
# b1.grid(row=3, column=0, sticky='ew')
# b2.grid(row=3, column=1, sticky='ew')
# b3.grid(row=3, column=2, sticky='ew')
#
# root.mainloop()
# from tkinter.messagebox import *
# while(1):
# showerror("오류","放棄。你無法擺脫這個錯誤。")
# from tkinter.messagebox import *
# if askyesno("확인", "Are you sure you want to run? 你確定要跑步嗎?"):
# while(1):
# showerror("오류","放棄。你無法擺脫這個錯誤。")
# else:
# pass
from tkinter import *
from tkinter.messagebox import *
root = Tk()
label = Label(root, text='blue flag')
label.pack()
https://wikidocs.net/132610#entry
top of page
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
20241105
20241105
댓글 0개
좋아요
댓글(0)
bottom of page