Advertisement
Guest User

Untitled

a guest
Dec 26th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. V2 6 18
  2. V3 6 22
  3. V4 6 26
  4. V5 6 30
  5. V6 6 34
  6. V7 6 22 38
  7. V8 6 24 42
  8. V9 6 26 46
  9. V10 6 28 50
  10. V11 6 30 54
  11. V12 6 32 58
  12. V13 6 34 62
  13. V14 6 26 46 66
  14. V15 6 26 48 70
  15. V16 6 26 50 74
  16. V17 6 30 54 78
  17. V18 6 30 56 82
  18. V19 6 30 58 86
  19. V20 6 34 62 90
  20. V21 6 28 50 72 94
  21. V22 6 26 50 74 98
  22. V23 6 30 54 78 102
  23. V24 6 28 54 80 106
  24. V25 6 32 58 84 110
  25. V26 6 30 58 86 114
  26. V27 6 34 62 90 118
  27. V28 6 26 50 74 98 122
  28. V29 6 30 54 78 102 126
  29. V30 6 26 52 78 104 130
  30. V31 6 30 56 82 108 134
  31. V32 6 34 60 86 112 138
  32. V33 6 30 58 86 114 142
  33. V34 6 34 62 90 118 146
  34. V35 6 30 54 78 102 126 150
  35. V36 6 24 50 76 102 128 154
  36. V37 6 28 54 80 106 132 158
  37. V38 6 32 58 84 110 136 162
  38. V39 6 26 54 82 110 138 166
  39. V40 6 30 58 86 114 142 170
  40.  
  41. import math
  42.  
  43. def pattern(ver):
  44. w = 21 + ((ver - 1) * 4) # Width
  45. h = 6 # First item
  46. t = (w - 1) - 6 # Last item
  47. r = t - h # Distance between first and last
  48. n = math.ceil(r/28) # Number of items in list - 1
  49.  
  50. if (w == 145):
  51. intervals = 26 # Anomaly
  52. else:
  53. intervals = math.ceil(r/n) # Ceiling to nearest multiple of 2
  54. intervals = intervals + (intervals % 2)
  55.  
  56. xs = [t]
  57. for m in (n-1) * [intervals]: xs.append(xs[-1] - m)
  58. xs.append(h)
  59. return list(reversed(xs))
  60.  
  61. for n in range(2, 41):
  62. print("Version {:2d}: {}".format(n, pattern(n)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement