It's Bogosearch, obviously.
Step 1 - Pick a pixel, at random.
Step 2 - Is the pointer here? If yes, go to step three. Else, go to step 1.
Step 3 - Return pixel.
1
2
In response to Crispy
|
|
In response to Jp
|
|
Ah, of course, silly me; that way our abstract PixelCollection class (the sole subclass of which is of course the TwoDimensionalPixelCollection class, which in turn is a superclass of TwoDimensionalRectangularPixelCollection) doesn't need to implement the Iterable interface. It's design genius!
|
1
2
Yeah, that's not very accurate. I'd say it's more like 100x. =P Assuming that the Java graphics interface used Swing, at least... it's amazing how Sun actually managed to make a simple user interface API so incredibly slow that it takes half a second just to respond to a mouse click, even on top-of-the-line machines! What are they doing, performing a linear search on the pixels of the screen in order to find the mouse pointer?