Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def gBB(c):
- a = 1
- b = c
- d = math.floor(math.sqrt(c))
- e = c - d**2
- n = int((c + 1)/2 - d)
- x = math.floor(math.sqrt(( (d+n)**2 - c))) - n
- # Upside down world
- f = e - (2 * d + 1)
- fn = n -1
- fd = int(math.sqrt(c - f))
- fx = math.floor(math.sqrt(( (fd+fn)**2 - c))) - fn
- # Indexes
- i = d + n
- j = x + n
- fi = int(fd + fn)
- fj = int(fx + fn)
- return (e, n, d, x, a, b), (f, fn, fd, fx, a, b), (i, j), (fi, fj)
- def stuff(c):
- d = math.floor(math.sqrt(c))
- e = c - d**2
- f = e - (2 * d + 1)
- print((e, d, c), (f, math.sqrt(c - f), c))
- print(gBB(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement