Applications Google
Menu principal

Post a Comment On: Only Python

"The 17x17 challenge: setting up the grid"

1 Comment -

1 – 1 of 1
Blogger Unknown said...

I stumbled onto your first 17x17 post earlier today and I've been playing around with the interpreter.

It looks like I resolved the intersection code in the same way:

def collision(b):
return (b & (b-1))

def checkcolors(colors):
rowcount = len(colors[0])

for color in colors:
for y in range(0, rowcount):
for y2 in range(y+1, rowcount):
if collision(color[y] & color[y2]):
return True
return False

I spent a pleasant chunk of the day devising attack strategies - you're right about it being something that seems simple on the surface.

8:19 PM

Spammers: none shall pass.
You can use some HTML tags, such as <b>, <i>, <a>

Comments on this blog are restricted to team members.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot