Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Created on 2014/5/16
- 第三題重作
- 輸入英文+數字 結果以點陣圖顯示 輸入空白則輸出五格空白
- '''
- cmap = ( (4,10,17,31,17),(30,17,30,17,30),(14,17,16,17,14),(30,17,17,17,30),
- (31,16,30,16,31),(31,16,30,16,16),(31,16,19,17,31),(17,17,31,17,17),
- (14,4,4,4,14),(7,2,2,10,4),(17,18,28,18,17),(16,16,16,16,31),
- (17,27,21,17,17),(17,25,21,19,17),(14,17,17,17,14),(30,17,30,16,16),
- (14,17,21,19,15),(30,17,30,18,17),(31,16,31,1,31),(31,4,4,4,4),
- (17,17,17,17,14),(17,17,17,10,4),(17,17,21,27,17),(17,10,4,10,17),
- (17,10,4,4,4),(31,2,4,8,31) )
- nmap =( (31,17,17,17,31),(4,4,4,4,4),(31,1,31,16,31),(31,1,31,1,31),(17,17,31,1,1),
- (31,16,31,1,31),(31,16,31,17,31),(31,2,4,8,8),(31,17,31,17,31),(31,17,31,1,31) )
- while True:
- data = str.upper(input('ABC+123:'))
- for i in range(len(data)):
- if 48<ord(data[i])<90:
- print('ok:')
- break
- for i in range(5):
- print()
- for j in range(len(data)):
- print(' ',end="")
- for k in range(5):
- if 65<=ord(data[j])<=90:
- pdata=cmap[ord(data[j])-65][i]
- elif 48<=ord(data[j])<=57:
- pdata=nmap[ord(data[j])-48][i]
- dot=pdata//(2**(4-k))%2
- if dot:
- print(data[j],end="")
- else:
- print(' ',end="")
- print('\n\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement