首页 > 代码库 > 背书吧!
背书吧!
打乱了,找线索,拼起来,再背。
import random s = ''' However, even NRZI can have long series of zeros (or ones if transitioning on "zero"), and thus clock recovery can be difficult unless some form of run length limited (RLL) coding is used in addition to NRZI. Magnetic disk and tape storage devices generally use fixed-rate RLL codes, while USB uses bit stuffing, which inserts an additional 0 bit after 6 consecutive 1 bits, thus forcing a transition. While bit stuffing is efficient, it results in a variable data rate because it takes slightly longer to send a long string of 1 bits than it does to send a long string of 0 bits. ''' ss = s.split() text = [] while ss: r = random.randint( 4, 7 ) t = reduce( lambda x, y : x + " " +y, ss[:r] ) if random.random() < 0.3: choice = random.choice( ss[:r] ) p = random.randint( 1, len( choice ) ) t = t.replace( choice, "*" + choice[p:] + choice[:p] ) text.append( t ) ss = ss[r:] random.shuffle( text ) for t in text: print " " * random.randint( 0, 15 ), t print
背书吧!
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。