![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python小游戏
JustSmile7
这个作者很懒,什么都没留下…
展开
-
猜数字小游戏
参考脚本如下,给出一个区间,最大值(top)和最小值(bottom),然后在这个区间里猜。【具体脚本】import random bot=int(input("set range bottom\n")) top=int(input("set range top\n")) rand=random.randint(bot,top) print("random number in["+str(bot)...原创 2018-03-30 17:42:01 · 340 阅读 · 0 评论 -
贪吃蛇
来自知乎:黄哥厉害了,我的哥完整的代码↓ 需要安装pygame包,稍微有点坎坷,无故断了几次import random import pygame import sys from pygame.locals import * Snakespeed = 5 Window_Width = 800 Window_Height = 500 Cell_Size = 20 # Width and hei...转载 2018-03-30 18:17:19 · 287 阅读 · 0 评论 -
python小窗口展示照片 idors practice
偶像练习生照片在小窗口框框里快速移动【代码】import pygame import sys from pygame.locals import * # 初始化Pygame pygame.init() clock = pygame.time.Clock() size = width, height = 600, 600 # 窗口 实际上是元组 speed = [-2, 1] bg = (15...原创 2018-03-30 19:09:37 · 357 阅读 · 1 评论 -
需改 turtle绘制表盘
debug了好久,最后终于表盘时钟走起。 代码参考如下 import turtle from datetime import * #up down 表示画笔抬起放下的过程,中间走了一定的步数,这里表示行走的过程 def Skip(step): turtle.penup() turtle.forward(step) turtle.pendown() #建立...原创 2018-03-31 14:05:05 · 432 阅读 · 0 评论