daniel-centore / amity-apcs-ge-2011

Automatically exported from code.google.com/p/amity-apcs-ge-2011
0 stars 0 forks source link

New Idea for Representing Board #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Me and Joe had a new idea for representing the pixelated board.  The board 
could be represented by blobs.  Each blob has a color, size, and list of 
neighbor blobs.  With a reference to the main blob, we can completely forget 
about the board of pixels and simply do operations using the blobs.  To change 
the color, we go through the list of the main blob's neighbors and check which 
ones have that color.  We then merge each of those blobs with the main blob by 
combining the sizes and neighbor lists.  This operation should be much faster 
than our current flood fill method.

One issue with this idea is that our current brute force algorithm makes many 
copies of the grid to try different color-change operations on it.  I don't 
know of a way that the blobs could be efficiently copied.  We would have to 
develop a way to represent the blobs in a way that they could be efficiently 
copied, or change the brute force algorithm.

Original issue reported on code.google.com by smd7...@gmail.com on 20 Mar 2011 at 2:05

GoogleCodeExporter commented 9 years ago

Original comment by drdaniel...@gmail.com on 20 Mar 2011 at 2:18

GoogleCodeExporter commented 9 years ago

Original comment by smd7...@gmail.com on 24 Mar 2011 at 3:43