From: James Edward Gray II Date: 2004-12-10T00:47:09+09:00 Subject: Re: [SUMMARY] Crosswords (#10) On Dec 9, 2004, at 8:55 AM, Brian Schr�der wrote: > Hello James, > > Nice summary, thanks you again. Did you benchmark the solutions, I > would be > interested in how fast/slow some approaches where. Especially those > that rely > heavily on string manipulation, vs. those that build up the layout in a > streaming fashion. I didn't benchmark this time no. Everything I ran was "faster than I blink" zippy. ;) >> (Note: This "collapsing borders" technique is common in many aspects >> of >> programming. Examine the output of the mysql command line tool, GNU >> Chess, >> or a hundred other tools. It's also common for GUI libraries to >> combine >> borders of neighboring elements.) >> > > One remark here, is that it is common for filling algorithms not to > draw each > border twice, but to draw only borders on two sides of the elements. > Especially > if you have a line drawing algorithm (e.g. Bresenham) and you draw > adjacent > lines of polygons twice, it is 1. a waste of energy and 2. rounding > errors may > lead to jitter, such that the lines do not overlap perfectly. > > (On a second read I'm not that shure that I understood you perfectly, > so if I > was ranting about something you already said, I'm sorry for the noise.) I should have written that note more clearly. I wasn't trying to say that drawing the borders twice was the technique to always use (though it works fine in many cases). I was trying to say that the need to collapse borders like that comes up a lot, however you accomplish it. My bad. James Edward Gray II