Commit 4140507d by BellCodeEditor

save project

parent ce6d9f66
Showing with 29 additions and 2 deletions
...@@ -2,13 +2,23 @@ import pygame ...@@ -2,13 +2,23 @@ import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
background = pygame.image.load('bg.png')
apple = pygame.image.load('apple.png')
莱莱 = pygame.image.load('right.png')
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((1000,2000)) screen=pygame.display.set_mode((660,500))
while True: while True:
for i in pygame.event.get(): for i in pygame.event.get():
if i.type==locals.QUIT: if i.type==locals.QUIT:
exit() exit()
screen.blit(background,(0,0))
screen.blit(apple,(100,50))
screen.blit(莱莱,(300,100))
pygame.display.update()
a=input("输入压岁钱")
a=int(a)
b=a//23
c=a%23
print('可买'+str(b)+'本书,剩'+str(c)+'元')
import turtle
turtle.goto(0,0)
turtle.pensize(5)
turtle.pencolor("red")
turtle.fillcolor("yellow")
turtle.begin_fill()
for i in range(5):
turtle.forward(300)
turtle.right(144)
turtle.end_fill()
turtle.done()
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