
Lv.1
以前那言论奇葩、无时不在创造黑历史的我,真的是我吗?或者…现在的我,只是过去的一片残影?
签名:摆烂(x) 努力更新小说(x) 做一只厚颜无 耻的肥鸽子,为人类解决粮食问题(✓(大雾))
在 《我的世界:模组风云》书评区 中回复
https://box3play.cod喵/games/91f05db0f83ce9976199
不管是路过的还是来吐槽的,不管你是Him还是Notch还是溺尸神,都来看看吧……
2020-08-29T19:26:41 点赞:0
在 《我的世界:模组风云》书评区 中回复
啦啦啦啦~
#this programme is coded to revise for the NCT test
#请注意,接下来的画面很惨烈!!!!!!高能预警
#变量
var=1
for a in range(1000):
var+=1
print(var)
if var >=80:
var=0
var=''
var+='fojfiefe'
var+='#the words before this is nonsense.'
print(var)
#字符串、整数、浮点数、布尔值
string='ooooohhhhh'
for s in string:
print(s)
int_=5
int_s='5'
int_s=int(int_s)
print(int_==int_s,int_+int_s,int_**int_s)
#float is the same as int.
bool_=True
bool_=not bool_
print(bool_)
print(1==2,1<2,1>2,1<=2,1>=2)
print(bool(1),bool(0),bool(''),bool(' a'))
#list
l=[1,2,4,6,3,2,5,6]
l.append(2)
l.reverse()
print(l)
print(l[3])
a=l.pop(4)
print(a,l)
l.remove(6)
print(l)
l2=[45,2,6,7,43]
l.append(l2)
print(l)
l.extend(l2)
print(l)
#tuple
t=(4,2,6,3)
try:
t.append(4)
except:
print('tuple is an unchangable thing')
#dict
d={'1':1,'2':2}
print(d['1'])
d['3']=3
print(d)
del d
try:
print(d)
except:
print('this dict does not exist')
#set
s={4,2,5,6,7,5,2,5}
print(s)
s2={3,6,4,2,7,5,1}
print(s|s2,s-s2)
#function
def shuaping(times,string):
for a in range(times):
print(string,end='')
shuaping(1000,'ooooooohhhhhhhh')
def digui(a):
a+=1
if a>=49:
return
print(a)
digui(a)
print(digui(34))
#class
class none():
def __init__(self):
self.none=[None]*10000
def None_(self):
print(self.none)
n=none()
n.None_()
class oo():
def __init__(self,times=1000):
self.nums=[]
self.times=times
def OO(self):
self.nums=[]
for a in range(self.times):
self.nums+='oo'
print(self.nums)
o=oo(10000)
o.OO()
class unknown(none,oo):
def __init__(self,times):
super().__init__()
self.attack=oo(10000)
def introduce(self):
print('I am an unknown monster.')
print('I am……')
self.OO()
print('and......')
self.None_()
print('My attack power:'+self.attack.nums)
#高能预警!
u=unknown(1000)
u.None_()
import time
print('复(dao)习(dan)完毕')
time.sleep(2)2020-08-31T20:01:26 点赞:0
在 《我的世界:模组风云》书评区 中回复
这次总算有点东西了。
#pygame revise
import pygame
import random
pygame.init()
screen=pygame.display.set_mode((800,600))
keep_going=True
#加载角色
chara=pygame.image.load('chara.png')
speed=5
x=400
y=300
#main loop
while keep_going:
screen.fill((random.randint(0,255),random.randint(0,255),random.randint(0,255)))
screen.blit(chara,(x,y))
x+=speed
if x>=800 or x<=0:
speed=-speed
pygame.display.update()
for event in pygame.event.get():
if event.type==pygame.QUIT:
keep_going=False
pygame.quit()2020-09-02T11:44:18 点赞:0
在 《我的世界:模组风云》书评区 中回复
下面↓的代码:
#pygame revise
import pygame
import random
pygame.init()
screen=pygame.display.set_mode((800,600))
keep_going=True
#加载角色
chara=pygame.image.load('chara.png')
xspeed=5
yspeed=4
x=400
y=300
#main loop
while keep_going:
screen.fill((random.randint(0,255),random.randint(0,255),random.randint(0,255)))
screen.blit(chara,(x,y))
x+=xspeed
y+=yspeed
#碰到边缘就反弹
if x>=800 or x<=0:
xspeed=-xspeed
if y>=600 or y<=0:
yspeed=-yspeed
pygame.display.update()
for event in pygame.event.get():
if event.type==pygame.QUIT:
keep_going=False
pygame.quit()
2020-09-02T11:49:42 点赞:0
在 《我的世界:模组风云》书评区 中回复
毫无卵用的渣渣库:
from pygame import *
from turtle import *
def 输出(内容='',间隔='\n'):
print(内容,sep=间隔)
def 输入(内容=''):
return input(内容)
class 海龟画笔(Pen):
def __init__(self):
super().__init__()
def 前进(self,距离=100):
self.forward(距离)
def 后退(self,距离=100):
self.backward(距离)
def 左转(self,角度=90):
self.left(角度)
def 右转(self,角度=90):
self.right(角度)
def 提笔(self):
self.up()
def 下笔(self):
self.down()
def 设置颜色(self,color='black'):
self.color(color)
def 设置速度(self,speed=0):
self.speed(speed)
def 重复执行(次数=100,代码体=输出):
for a in range(次数):
代码体()
以及使用案例:
from 中文 import *
#测试环节
画笔 = 海龟画笔()
长度 = 1
画笔.设置速度()
def 直线():
global 长度
画笔.前进(长度)
长度 += 1
画笔.左转()
重复执行(1000, 直线)
你看看都用上global关键字了,人家都会这个了还用中文编程干啥!!!!
再说人家都会def定义函数了,为啥要用中文!!!!!!!!!!!!
(我·吐·槽·自·己)
2020-09-02T20:01:08 点赞:0
在 《我的世界:模组风云》书评区 中回复
我另外一个还行的库:
drawshape.py
'''you can draw beautiful pictures by this module based on turtle'''
import turtle
import time
import wows
import spirals
import shapes
t=turtle.Pen()
t.speed(0)
def draw_Rose(howmany=6,size2=50,speed2=0,color='white'):
'''Draw a rose.(Why do I have to do that??????After all,it's not a beautiful rose~......)
Arguments:
howmany
size
x
y
speed
'''
t=turtle.Pen()
t.pencolor(color)
t.speed(speed2)
turtle.bgcolor('black')
for a in range(howmany):
t.circle(size2)
t.left(360/howmany)
#def asktext(title,q):
#'''=textinput'''
#turtle.textinput(title,q)
def _print(thing=' ',color='red',font='Arial',size=100):
'''=t.write'''
t=turtle.Pen()
t.color(color)
t.write(thing,font=(font,size,'bold'))
shapes.py
import turtle
def draw_Square(size1=100, x1=0, y1=0, speed1=0, color='white'):
'''Draw a 喵.
Arguments:
size
x,y
speed
'''
t = turtle.Pen()
t.pencolor(color)
t.speed(speed1)
t.penup()
t.setpos(x1, y1)
t.pendown()
turtle.bgcolor('black')
for a in range(4):
t.forward(size1)
t.left(90)
def draw_Rectangle(width=300,height=200, x1=0, y1=0, speed1=0, color='white'):
'''Draw a 喵.
Arguments:
size
x,y
speed
'''
t = turtle.Pen()
t.pencolor(color)
t.speed(speed1)
t.penup()
t.setpos(x1, y1)
t.pendown()
turtle.bgcolor('black')
for a in range(2):
t.forward(width)
t.left(90)
t.forward(height)
t.left(90)
spirals.py
import turtle
def text_spiral(text=None, size=100, x=0, y=0, color='white', bgcolor='black'):
'''draw a spiral,but using text!'''
t = turtle.Pen()
turtle.bgcolor(bgcolor)
t.pencolor(color)
t.penup()
t.setpos(x, y)
for a in range(size):
t.penup()
t.forward(a*size-(a*size/1.05))
t.pendown()
t.write(text, font=('Arial', int((x+size/25)/size/25), 'bold'))
t.left(92)
def draw_Spiral(side=6, size=360, color2='white', speed=0):
'''draw a spiral.
Arguments:
side
size
color
x,y
speed
'''
t = turtle.Pen()
t.speed(speed)
turtle.bgcolor('black')
color1 = ['red', 'yellow', 'blue', 'orange', 'green', 'purple']
if color2 == 'colorful':
for a in range(size):
w = 1
t.pencolor(color1[a % side])
w = 1
t.forward(a*3/side+a)
t.left(360/side+1)
t.width(w)
w += 10
else:
for a in range(size):
t.pencolor(color2)
w = 1
t.forward(a*3/side+a)
t.left(360/side+1)
t.width(w)
w += 10
wows.py
import turtle
import random
t = turtle.Pen()
def spiral_sss(size=1000, color='white', bgcolor='black', x=0, y=0):
'''draw one of the incredible shape'''
t = turtle.Pen()
t.speed(0)
b = 1
turtle.bgcolor(bgcolor)
t.pencolor(color)
t.penup()
t.setpos(x, y)
t.pendown()
for a in range(size):
t.forward(b)
t.left(26)
b += 0.1
t.up()
t.goto(0, 0)
def radar(size=1000, color='white', bgcolor='black', x=0, y=0,angle_each=10,length_each=0.1):
'''draw one of the incredible shape,but randomer!'''
t = turtle.Pen()
t.speed(0)
b = 1
turtle.bgcolor(bgcolor)
t.pencolor(color)
t.penup()
t.setpos(x, y)
t.pendown()
for a in range(size):
t.forward(b)
t.left(angle_each)
b += length_each
t.up()
t.goto(0, 0)
使用案例:
import drawshape
import turtle
drawshape.wows.radar(length_each=0.05)
drawshape.spirals.draw_Spiral()
drawshape._print('阿巴阿巴阿巴')
turtle.done()
案例结果:

2020-09-02T20:13:54 点赞:0
在 《我的世界:模组风云》书评区 中回复
每日一问
类型:python——海龟
难度:5星

问:这个图形是怎么画出来的?
提示去https://shequ.codemao.cn/community/339705
(答对获得100源码币(前提是你有作品))
2020-09-03T11:42:25 点赞:0
在 《我的世界:模组风云》书评区 中回复
*************************modcn太慢了!!!!!!!!!!!!!!
(啊啊啊加载好了!!)
(瓦特?这个潘马斯农场模组里……尽然有老干妈??)
2020-09-05T20:09:40 点赞:0