Skip to content

Instantly share code, notes, and snippets.

@crazygao
Created December 12, 2016 14:44
Show Gist options
  • Save crazygao/10a59679a2a6064fdc763984dc7fe632 to your computer and use it in GitHub Desktop.
Save crazygao/10a59679a2a6064fdc763984dc7fe632 to your computer and use it in GitHub Desktop.
Just a poster for special cases...
import sys
coordinates = [
[(1,5), (6,12), (45,47)],
[(6,8), (14,16), (45,47)],
[(6,8), (14,16), (26,28), (30,32), (35,38), (39,42), (45,47), (50,52), (55,59)],
[(6,8), (14,16), (17,19), (24,26), (30,32), (36,38), (41,43), (45,47), (49,51), (54,56)],
[(6,8), (14,16), (19,21), (23,25), (30,32), (36,38), (41,43), (45,49), (56,59)],
[(6,8), (14,16), (19,21), (24,26), (30,32), (36,38), (41,43), (45,47), (49,51), (58,60)],
[(6,8), (14,16), (19,21), (25,29), (30,33), (35,38), (41,43), (45,47), (50,52), (54,56), (58, 60)]
]
def writeArrow(a, b):
sys.stdout.write('>' + '=' * (b - a - 1) + '>')
def writeSpace(a, b):
sys.stdout.write(' '*(b - a - 1))
for line in coordinates:
lasty = 0
for item in line:
x, y = item
writeSpace(lasty, x)
writeArrow(x, y)
lasty = y
sys.stdout.write('\n')
@crazygao
Copy link
Author

Thanks in ASCII arts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment