Guest User

Generate genesis cell

a guest
Dec 16th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. If y'all haven't noticed, there's horizontal patterns to the grid (e,1) cell groups. I've been able to generate any "genesis" row (the first row in a (e,1) group using this python code:
  2. #########################################
  3. def generate_genesis_cell(ee):
  4.     cell = []
  5.     xx = ee%2  
  6.     aa = int(ee/2) + xx
  7.     #nn = (xx**2 + ee)/2
  8.     nn = 1
  9.     bb = aa + 2*xx + 2*nn
  10.     cc = aa*bb
  11.     eqn = [1, 2*nn, -1*(cc+xx**2+2*nn*xx)]
  12.     dd = np.roots(eqn)
  13.     if dd[0] > 0:
  14.         dd = dd[0]
  15.     else:
  16.         dd = dd[1]
  17.     #print("\ne:n:d:x:a:b")
  18.     cell = to_int([ee, nn, dd, xx, aa, bb])
  19.     #print(cell)
  20.     return cell
  21. #########################################
  22. Keep in mind that I only took the pattern for one parameter and calculated all the rest from it, which is costly. It's possible to find the pattern for some if not all the other parameters and just calculate it like I did for "x", which would save time. I'll do that after I get the rest of it working.
Add Comment
Please, Sign In to add comment