Advertisement
here2share

# b_str_matrix_of_4.py

Nov 10th, 2021
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. # b_str_matrix_of_4.py
  2.  
  3. import string
  4.  
  5. ww = 100
  6. hh = 100
  7.  
  8. alpha = string.letters
  9.  
  10. xy = [[] for z in range(ww*hh)]
  11.  
  12. abc = []
  13.  
  14. for x in alpha:
  15.     for y in alpha+'0123456789':
  16.         for z in alpha+'0123456789':
  17.             t = x+y+z
  18.             if not t.isalpha():
  19.                 exec(t+'=(255,255,0)')
  20.                 abc.append(t)
  21.                
  22. L = len(abc)
  23. print L
  24.  
  25. for y in range(hh):
  26.     for x in range(ww):
  27.         t = y*ww+x
  28.         xy[t] += [abc[y]]
  29.         xy[t] += [abc[x+ww]]
  30.         xy[t] += [abc[y+ww*2-x]]
  31.         xy[t] += [abc[y+ww*3+x]]
  32. 0
  33.  
  34. matrix = '['+','.join(['({}+{}+{}+{})'.format(*z) for z in xy])+']'
  35. print matrix
  36.  
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement