Advertisement
here2share

# mono_visual.py

Sep 20th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.48 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. # mono_visual.py for mono-type editors
  3.  
  4. maze='''
  5. ∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎
  6. ∎.p. . . . .∎. . . .∎.x. . . . . . .∎
  7. ∎. .∎.∎.∎.x.∎. .∎. .∎. .∎.∎.∎.∎.∎. .∎
  8. ∎. . . . . . . .∎. . . . . . .b.∎. .∎
  9. ∎.∎.∎. .∎. .∎. .∎. .∎. .∎. .∎. .∎. .∎
  10. ∎. . . .∎. .∎. .∎. .∎. .∎. . . . .x.∎
  11. ∎. .∎. .∎. .∎. . . . . .∎.x.∎. .∎.∎.∎
  12. ∎. .∎.x.∎. .∎.∎.∎. .∎. . . .∎. . . .∎
  13. ∎. . . . . . . . . .∎.∎.∎. .∎. .∎. .∎
  14. ∎.∎.∎. .∎.∎.∎.∎.∎. .∎. . . .∎. . . .∎
  15. ∎. . . .∎. . . .∎. .∎.x.∎.∎.∎.∎.∎. .∎
  16. ∎. .∎.∎.∎. .∎.x. . . . . . .∎. . . .∎
  17. ∎. .x. .∎. .∎. .∎.∎.∎.∎.∎. .∎. .∎.∎.∎
  18. ∎. .∎. . . . . . . . . .∎. . . . . .∎
  19. ∎. .∎.∎.∎. .∎.∎.∎. .∎. .∎. .∎.∎.∎. .∎
  20. ∎. . .r. . . . . .x.∎. . . . .g.∎.x.∎
  21. ∎. .∎.∎.∎. .∎. .∎. .∎. .∎. .∎. .∎. .∎
  22. ∎. .x. . . .∎. . . . . . . .∎. . . .∎
  23. ∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎.∎
  24. '''
  25.  
  26. def qrepl(zzz,r):
  27.     for z in r:
  28.         zzz=zzz.replace(z[0],z[1])
  29.     zzz=zzz.split()
  30.     r=[]
  31.     for z in zzz:
  32.         r.append([int(x) if x.isdigit() else x for x in list(z)])
  33.     return r
  34. fix=[['.',''],[' ','0'],['∎','1'],['x','2']]
  35.  
  36. print qrepl(maze,fix)
  37.  
  38. print '''
  39. ╔╦╗
  40. ╠╬╣
  41. ╚╩╝
  42.  
  43. ╔═╗
  44. ║║║
  45. ╚═╝
  46. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement