-
个人简介
该用户很懒,这里啥都写了 (´・ω・`)…………(本用户已移入c++)
本人状态:摆烂ing 撕作业ing 摸鱼ing (◐‿◑) ……
from tkinter import* root=Tk() c=Canvas(root,width=400,height=400) c.configure(bg='dark blue',highlightthickness=0) c.body_colour='SkyBlue1' body=c.create_oval(35,20,365,350,outline=c.body_colour,fill=c.body_colour) ear_left=c.create_polygon(75,80,75,10,165,70,outline=c.body_colour,fill=c.body_colour) ear_right=c.create_polygon(255,45,325,10,320,70,outline=c.body_colour,\ fill=c.body_colour) foot_left=c.create_oval(65,320,145,360,outline=c.body_colour,fill=c.body_colour) foot_right=c.create_oval(250,320,330,360,outline=c.body_colour,fill=c.body_colour) eye_left=c.create_oval(130,110,160,170,outline='black',fill='white') pupil_left=c.create_oval(140,145,150,155,outline='black',fill='black') eye_right=c.create_oval(230,110,260,170,outline='black',fill='white') pupil_rignt=c.create_oval(240,145,250,155,outline='black',fill='black') mouth_normal=c.create_line(170,250,200,272,230,250,smooth=1,width=2,state=NORMAL) def toggle_eyes(): current_color=c.itemcget(eye_left,'fill') new_color=c.body_colour if current_color=='white'else 'white' current_state=c.itemcget(pupil_left,'state') new_state=NORMAL if current_state==HIDDEN else HIDDEN c.itemconfigure(pupil_left,state=new_state) c.itemconfigure(pupil_rignt,state=new_state) c.itemconfigure(eye_left,fill=new_color) c.itemconfigure(eye_right,fill=new_color) def blnk(): toggle_eyes() root.after(250,toggle_eyes()) root.after(3000,blnk()) root.after(1000,blnk()) root.mainloop() c.pack()
from itertools import cycle from random import randrange from tkinter import Canvas, Tk, messagebox, font canvas_width = 800 canvas_height = 400 root = Tk() c = Canvas(root, width=canvas_width, height=canvas_height, background='deep sky blue') c.create_rectangle(-5, canvas_height - 100, canvas_width + 5, canvas_height + 5, \ fill='sea green', width=0) c.create_oval(-80, -80, 120, 120, fill='orange', width=0) c.pack() color_cycle = cycle(['light blue', 'light green', 'light pink', 'light yellow', 'light cyan']) egg_width = 45 egg_height = 55 egg_score = 10 egg_speed = 500 egg_interval = 4000 difficulty_factor = 0.95 catcher_color = 'blue' catcher_width = 100 catcher_height = 100 catcher_start_x = canvas_width / 2 - catcher_width / 2 catcher_start_y = catcher_height - catcher_height +250 catcher_start_x2 = catcher_start_x + catcher_width catcher_start_y2 = catcher_start_y + catcher_height catcher = c.create_arc(catcher_start_x, catcher_start_y,\ catcher_start_x2, catcher_start_y2, start=200, extent=140,\ style='arc', outline=catcher_color, width=3) game_font = font.nametofont('TkFixedFont') game_font.config(size=18) score = 0 score_test = c.create_text(10,10,anchor='nw',font=game_font,fill='darkblue',text='Score'+str(score)) lives_eremaining=3 lives_test=c.create_text(canvas_width-10,10,anchor='ne',font=game_font,fill='darkblue',\ text='Lives:'+str(lives_eremaining)) eggs=[] def create_egg(): x=randrange(10,740) y=40 new_egg=c.create_oval(x,y,x+egg_width,y+egg_height,fill=next(color_cycle),width=0) eggs.append(new_egg) root.after(egg_interval,create_egg) def move_eggs(): for egg in eggs: (egg_x,egg_y,egg_x2,egg_y2)=c.coods(egg) c.move(egg,0,10) if egg_y2>canvas_height: pass root.after(egg_speed,move_eggs) '''def egg_droppend(egg): eggs.remove(egg) c.delete(egg) lost_a_life() if lives_eremaining==0: messagebox.showinfo('Game Over','Final Score:'+str(score)) root.destroy()''' def lost_a_life(): global lives_eremaining lives_eremaining-=1 c.itemconfigure(lives_test,text='Lives:'+str(lives_eremaining)) def check_catch(): (catcher_x,catcher_y,catcher_x2,catcher_y2)=c.coords(catcher) for egg in eggs: (egg_x, egg_y, egg_x2, egg_y2) = c.coords(egg) if catcher_x<egg_x and egg_x2 <catcher_x2 and catcher_y2<egg_y2<40 : eggs.remove(egg) c.delete(egg) increase_score(egg_score) root.after(100,check_catch()) def increase_score(points): global score,egg_speed,egg_interval score+=points egg_speed=int(egg_speed*difficulty_factor) egg_interval=int(egg_interval*difficulty_factor) c.itemconfigure(score_test,test='Score:'+str(score)) def move_left(event): (x1,y1,x2,y2)=c.coords(catcher) if x1>0: c.move(catcher,-20,0) def move_right(event): (x1, y1, x2, y2) = c.coords(catcher) if x2 < canvas_width: c.move(catcher, 20, 0) c.bind('<Left>',move_left) c.bind('<Right>',move_right) c.focus_set() root.after(1000,create_egg) root.after(1000,move_eggs) #root.after(1000,check_catch) root.mainloop()
AC: awful correct 粗劣的答案
WA:wonderful answer 完美的答案
RE: right ending 运行成功
CE:compiled easily 轻松通过编译
TLE:time limit enough 时间充裕
MLE:memory limit enough 空间充裕
OLE:output length excellent 输出长度完美
AK:all knocked-off 全部失败
-
通过的题目
- P0020
- P0010
- P0030
- P0040
- P0050
- P0060
- P0070
- P0080
- P0090
- P0100
- P0110
- P0120
- P0130
- P0140
- P0150
- P0160
- P0170
- P0180
- P0190
- P0200
- P0210
- P0220
- P0230
- P0240
- P0250
- P0260
- P0320
- P0270
- P0280
- P0290
- P0300
- P0310
- P0330
- P0340
- P0350
- P0360
- P0370
- P0380
- P0390
- P0400
- P0455
- P0420
- P0430
- P0440
- P0450
- P0460
- P0470
- P0480
- P0490
- P0500
- P0510
- P0520
- P0530
- P0540
- P0550
- P0560
- P0630
- P0640
- P0650
- P0660
- P0670
- P0680
- P0690
- P0700
- P0710
- P0720
- P0730
- P0800
- P0790
- P0780
- P0770
- P0760
- P0750
- P0740
- P0970
- P0990
- P0980
- P1000
- P1010
- P1020
- P1045
- P1050
- P1060
- P1070
- P1090
- P1120
- P1140
- P1150
- P1160
- P1036
- P1470
- P1530
- P1540
- P1550
- P1560
- P1520
- P1570
- P1580
- P1590
- P1600
- P1610
- P1620
- P1630
- P1640
- P1650
- P1670
- P1660
- P0930
- P0931
- P0932
- P0933
- P0934
- P0935
- P0936
- P0937
- P0938
- P0939
- P0940
- P0941
- P0942
- P0943
- P0945
- P0944
- P0948
- P0949
- P0950
- P0951
- P0952
- P0953
- P0954
- P0955
- P1040
- P1041
- P1042
- P1043
- P1044
- P0946
- P0947
- P2120
- Pt01
- Pt02
- Pt03
- Pt04
- Pt05
- Pt06
- Pt11
- Pt12
- Pt13
- Pt21
- Pt22
- Pt23
- Pt24
- Pt25
- Pt26
- zt101
- zJZ001
- zJZ002
- zJZ003
- zJZ004
- zJZ005
- zJZ006
- zJZ007
- zJZ008
- zJZ009
- zJZ010
- ZA0007
- ZA0011
- ZA0012
- ZA0016
- ZA0017
- ZA0001
- ZA0002
- ZA0006
- PITC0026
- ZD0002
- ZA0021
- ZA0022
- S001
- S002
- S003
- S004
- S006
- S008
- S005
- S007
- S009
- S010
- S011
- S012
- P1130
- P1030
- P1031
- P1032
- P1033
- P1034
- P1035
- P1038
- P1039
- P1621
- PSW005
- PSW007
- PSW008
- PSW006
- PSW001
- PSW002
- PSW003
- PSW004
- PJX51017
- PJX51018
- PJX51019
- PJX51020
- PJX51001
- PJX51005
- PJX51008
- PJX51009
- PJX51010
- PJX51015
- PJX51XZ01
- PXZ004
- c3ji002
- c3ji003
- p3ji005
- p3jiqh002
- p3jiqh004
- p3jiqh005
- p3jiqh006
- p3jiqh007
-
最近活动
- Python三级测评 IOI
- 竞赛集训-客观题训练4 IOI
- 竞赛集训-客观题训练3 IOI
- 竞赛集训-客观题训练2 IOI
- 竞赛集训-客观题训练1 IOI
- 五一集训-第四场 IOI
- 五一集训-第三场 IOI
- 五一集训-第二场 IOI
- 五一集训-第一场 IOI
- 竞赛集训-编程题初阶0 IOI
- 竞赛集训-编程题高阶6 IOI
- 竞赛集训-编程题高阶5 IOI
- 竞赛集训-编程题高阶4 IOI
- 竞赛集训-编程题高阶3 IOI
- 竞赛集训-编程题进阶8 IOI
- 竞赛集训-编程题进阶7 IOI
- 竞赛集训-编程题进阶6 IOI
- 竞赛集训-编程题初阶8 IOI
- 竞赛集训-编程题初阶7 IOI
- 竞赛集训-编程题初阶6 IOI
- 竞赛集训-编程题初阶5 IOI
- 竞赛集训-编程题终阶2 IOI
- 竞赛集训-编程题进阶5 IOI
- 竞赛集训-编程题进阶4 IOI
- 竞赛集训-编程题高阶2 IOI
- 竞赛集训-编程题高阶1 IOI
- 竞赛集训-编程题初阶4 IOI
- 竞赛集训-编程题初阶3 IOI
- 竞赛集训-编程题终阶1 IOI
- 竞赛集训-编程题进阶3 IOI
- 竞赛集训-编程题进阶2 IOI
- 竞赛集训-编程题初阶2 IOI
- 竞赛集训-编程题初阶1 IOI
- 竞赛集训-编程题进阶1 IOI
-
Stat
-
Rating
题目标签
- 一级
- 74
- 二级
- 57
- 三级
- 34
- 国旗挑战赛
- 11
- 计算核心1
- 11
- 计算核心2
- 11
- 五一集训
- 11
- 阶段练习2
- 9
- for循环
- 9
- 第一节
- 8
- 第一节(变量)
- 8
- 第二节
- 8
- 第二节(函数)
- 8
- 第三节
- 7
- 数位分解
- 7
- 阶段练习一
- 6
- 比较运算与逻辑运算
- 6
- 返回值
- 6
- 列表进阶与for循环
- 6
- 字符串
- 5