Commit f215a9a3 by BellCodeEditor

auto save

parent bf766557
# 悟空想海龟作图画出弹簧隧道,但是出现了bug,运行不了,请你帮助他,修改bug~
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
pen.speed('fast')
pen.hideturtle()
screen.bgcolor('black')
i=0
while i<135:
screen.pencolor('pink')
pen.penup()
pen.goto(0,0)
pen.forward(200)
pen.pendown()
screen.circle(100)
pen.left(2)
i+=1
turtle.done()
\ No newline at end of file
# 勇于挑战的创造师,下面的代码犯了两类典型错误,请你把bug揪出来吧。
area = ['盘丝洞','白骨洞','大雁塔']
monster = {'盘丝洞':'蜘蛛精','白骨洞': '白骨精','大雁塔':'花妖'}
# 打印出大雁塔
print(area[2])
# 向字典中添加 '地府':'僵尸'
monster['地府']='僵尸'
print(monster)
\ No newline at end of file
for i in range(1,1):
for i in range(1,1):
print(0)
\ No newline at end of file
import random
import random
while True:
computer = random.randint(1,3)
player = int(input("请输入你的猜拳数字石头(1),剪刀(2),布(3):"))
if player==0:
break
print("电脑出",computer)
if (player == 1 and computer == 2) or (player == 2 and computer == 3) or (player == 3 and computer == 1):
print("嗷嗷,电脑弱爆了")
if player == computer:
print("心有灵犀,再来一局")
else:
print("不要走,决战到天亮")
print("游戏结束")
# a=1
# a=1
# while a<=9:
# b=1
# while b<=a:
# print("%dx%d=%d"%(a,b,a*b),end="\t")
# b+=1
# print()
# a+=1
for i in range(1,10):
for j in range(1,i+1):
print("%dx%d=%d"%(i,j,i*j),end="\t")
print()
for i in range(100,1000):
for i in range(100,1000):
\ No newline at end of file
import pygame
import pygame
from pygame import locals
# 初始化pygame,为使用硬件做准备
pygame.init()
# 创建一个窗口
screen = pygame.display.set_mode((660, 480))
# 背景
background = pygame.image.load('贪吃蛇一/image/bg.png')
right = pygame.image.load('贪吃蛇一/image/right.png')
food = pygame.image.load('贪吃蛇一/image/apple.png')
body = pygame.image.load('贪吃蛇一/image/body.png')
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇画上去
screen.blit(right, (240, 120))
# 将贪吃蛇的身体画上去
screen.blit(body, (210, 120))
screen.blit(body, (180, 120))
screen.blit(body, (180, 90))
# 将果实画上去
screen.blit(food, (360, 300))
# 刷新画面
pygame.display.update()
\ 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