[关闭]
@rfhongyi 2016-09-26T03:10:42.000000Z 字数 2159 阅读 716

Exercise_03 : Make your name do some action on screen

冉峰 弘毅班 2014301020064


Abstract


Background


The Main Body

Code

  1. print('My name is Feng')
  2. x=int(input('input a number:'))
  3. for i in range(x):
  4. print(i*' '+'######### ')
  5. print(i*' '+'# ')
  6. print(i*' '+'# # # # # ')
  7. print(i*' '+'######### # # # # # # # # ')
  8. print(i*' '+'# # # # # # # # ')
  9. print(i*' '+'# ########## # # # # ')
  10. print(i*' '+'# # # # # # ')
  11. print(i*' '+'# # # # # # # # # ## ')
  12. print(i*' '+'# # # # # # # # # ')
  13. print(i*' '+' # ')
  14. print(i*' '+' # # ')
  15. print(i*' '+' # # ')
  16. print(i*' '+' # # # # ')
  17. if i==x-1:
  18. break
  19. import time
  20. time.sleep(0.2)
  21. import os
  22. i=os.system('cls')
  1. import os
  2. import time
  3. a=['#####'
  4. ,' # '
  5. ,' # '
  6. ,' # '
  7. ,'#####']
  8. for i in range(len(a)):
  9. print (a[i])
  10. time.sleep(1)
  11. os.system('cls')
  12. for j in range(5):
  13. con2=''
  14. for i in range(len(a)):
  15. con2=con2+a[i][j]
  16. print (con2)
  17. time.sleep(1)
  18. os.system('cls')
  19. for i in range(len(a)):
  20. print (a[i])
  21. time.sleep(1)
  22. os.system('cls')
  23. for j in range(5):
  24. con2=''
  25. for i in range(len(a)):
  26. con2=con2+a[i][j]
  27. print (con2)
  28. time.sleep(1)
  29. os.system('cls')
  30. for i in range(len(a)):
  31. print (a[i])
  32. time.sleep(1)
  33. os.system('cls')
  34. for j in range(5):
  35. con2=''
  36. for i in range(len(a)):
  37. con2=con2+a[i][j]
  38. print (con2)
  39. time.sleep(1)
  40. os.system('cls')
  41. for i in range(len(a)):
  42. print (a[i])
  43. time.sleep(1)
  44. os.system('cls')
  45. for j in range(5):
  46. con2=''
  47. for i in range(len(a)):
  48. con2=con2+a[i][j]
  49. print (con2)
  50. time.sleep(1)
  51. os.system('cls')
  1. import time
  2. import os
  3. f = open('1.txt','r')
  4. line = f.readline()
  5. a = []
  6. while line:
  7. line = line[:-1]
  8. a.append(line)
  9. line = f.readline()
  10. f.close()
  11. matrix = list(a)
  12. for b in a:
  13. matrix[matrix.index(b)] = list(b)
  14. while True:
  15. str = ""
  16. for i in range(80):
  17. str = "".join(matrix[i])
  18. print str
  19. print
  20. time.sleep(0.5)
  21. os.system('cls')
  22. #linux(mac os)use os.system('clear')
  23. for layer in range(39):
  24. first = layer
  25. last = 79 - layer
  26. for i in range(last):
  27. offset = i-layer
  28. top = matrix[first][i]
  29. matrix[first][i] = matrix[last-offset][first]
  30. matrix[last-offset][first] = matrix[last][last-offset]
  31. matrix[last][last-offset] = matrix[i][last]
  32. matrix[i][last] = top

1.txt

Running


Conclusion


Thanks For

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注