Commit 28b1bcab by BellCodeEditor

auto save

parent c62ee935
Showing with 28 additions and 21 deletions
'''
lis=[2,8,3,6,5,3,8]
a=[]
for i in :
if == :
a.append(i)
print(a)
for j in a:
lis.pop(j)
print(lis)
'''
count=0
while count<50:
count+=1
if count%2==0:
continue
print(count,end='')
\ No newline at end of file
...@@ -13,7 +13,7 @@ background = pygame.image.load('bg.png') ...@@ -13,7 +13,7 @@ background = pygame.image.load('bg.png')
right = pygame.image.load('right.png') right = pygame.image.load('right.png')
food = pygame.image.load('apple.png') food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
head = "right"
x,y = 240,120 x,y = 240,120
liebiao=[(180,90),(180,120),(210,120),(x,y)] liebiao=[(180,90),(180,120),(210,120),(x,y)]
while True: while True:
...@@ -22,8 +22,23 @@ while True: ...@@ -22,8 +22,23 @@ while True:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if if event.type == K_UP and head != "down":
x+=30 head = "up"
if event.type == K_DOWN and head != "up":
head = "down"
if event.type == K_LEFT and head != "right":
head = "left"
if event.type == K_RIGHT and head != "left":
head = "right"
if head == "up":
y-=30
elif head == "down":
y+=30
elif head=="left":
x-=30
else:
x+=30
liebiao.append((x,y)) liebiao.append((x,y))
liebiao.pop(0) liebiao.pop(0)
......
import turtle as t
import turtle as t
for i in range(4):
t.seth((i+1)*90)
t.circle(50,90)
t.seth(-90+90*i)
t.circle(50,90)
t.hideturtle()
t.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment