Slashdot Mirror


Man Spends 2,200 Hours Defeating Bejeweled 2

An anonymous reader writes "A California steel contractor spent 2,200 total hours over the last three years racking up a high score in Bejeweled 2. He exceeded the 2^31-1 maximum score programmed for the score display, proving that there is, in fact, an end to the game. I suppose congratulations or condolences are in order."

1 of 179 comments (clear)

  1. Because of libraries and external dependencies by KingSkippus · · Score: 4, Informative

    Why would you use a signed integer for a value like this?

    An honest, practical answer:

    Because most people who develop software link to other libraries, and many of those libraries don't have overloaded functions that take unsigned ints as parameters.

    For example, C#'s String.Substring function takes Int32s as parameters. So if you're using an UInt32 called x to hold some kind of index that you want to use in that function, you have to 1) check to see if x is less than zero (or better yet, less than UInt32.MinValue), and if so, throw an exception, then 2) cast x to an Int32, which takes a miniscule amount of time and resources.

    It's much easier just to define x as an Int32, even if you never intend for it to be negative.

    In the case of Bejewelled, I can only guess as to what dependencies might exist. Maybe the graphics routine to display the score on the screen is some kind of DisplayNumber(Int32 number,...) function that is generic enough so that they can write the function to display any number, positive or negative, and not have to build and maintain (and risk breaking when the code is updated) yet another function to do the same thing with uints because some weird bizarre edge cases exist where people use numbers > 2^31 but for whatever reason can't just use an Int64 instead.