Advertisement
triclops200

Grapher.py

Aug 10th, 2013
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. #Grapher.py
  3. #Author Triclops200
  4. grid = []
  5. for y in range(21):
  6.     grid.append([])
  7.     for x in range(41):
  8.         if (y-10) == (x-20)**2:
  9.             grid[y].append("*")
  10.         elif x == 20 and y == 10:
  11.             grid[y].append("+")
  12.         elif x == 20:
  13.             grid[y].append("|")
  14.         elif y == 10:
  15.             grid[y].append("-")
  16.         else:
  17.             grid[y].append(" ")
  18. out = []
  19. for xs in grid:
  20.     st = ""
  21.     for x in xs:
  22.         st += x
  23.     st += '\n'
  24.     out.append(st)
  25. out.reverse()
  26. print("".join(out))
  27. ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement