Slashdot Mirror


Obfuscated Vote Counting Contest

Daniel Horn writes "In a flash of inspiration coming from the Obfuscated C code contest and the current E-voting scandals, I wondered if there shouldn't be a similar code obfuscation contest based on obfuscating voting results, that is, C code that appears correct but does the wrong thing when counting votes. Submit your obfuscated vote-counting code now, and the two winners will be selected on November 2 and will receive a free Vega Strike CD. Obviously incorrect code, however, is not welcome."

8 of 223 comments (clear)

  1. Summary of this year's election by Dancin_Santa · · Score: 5, Insightful

    enum Outcome
    {
    AMERICAWINS,
    AMERICALOSES
    }

    int main()
    {
    bool voted = didYouVote();

    Outcome o;

    switch (voted)
    {
    case true:
    o = AMERICAWINS;
    case false:
    o = AMERICALOSES;
    }
    return o;
    }

    1. Re:Summary of this year's election by fossa · · Score: 2, Insightful

      AVP: No matter who wins, we lose.

    2. Re:Summary of this year's election by Anonymous Coward · · Score: 3, Insightful

      I don't know if you're trying to encourage voting or proposing code for the contest but by leaving out the "break;" in your switch statment I think you've certainly predicted the outcome of this year's elections.

  2. Re:last election by ezzzD55J · · Score: 3, Insightful

    forgetting strcmp() returns 0 when strings match are we?

  3. Re:my submission by Peyna · · Score: 2, Insightful

    I fail to trust any poll, because most of them only call during the day, when a certain group of people are home, and another group are likely to not be home. They also do not include a large number of younger voters, who are less likely to respond to a survey, and are more likely to have a cell phone and not a landline phone (which means they won't be called.)

    The pollsters "are hoping" that young people continue their streak of not voting much, so their numbers remain accurate.

    It's all B.S.

    --
    What?
  4. This is pretty much accurate: by Anonymous Coward · · Score: 5, Insightful

    if(voter.ethnicity != WHITE)
    return 0;
    if(GetVote(&voter))
    {
    switch(voter.vote)
    {
    case BUSH:
    case KERRY:
    ++BusinessAsUsual;
    break;
    default:
    AlertFBI();
    }
    }

  5. Ken Thompson's compiler hack by FleaPlus · · Score: 5, Insightful

    The best way to do this would be a variant of Ken Thompson's cc hack, published in ACM back in 1984. Basically the voting code would be pristine, but the compiler itself would be modified to add in "features" at compile time. The compiler also had hooks to add in the trojans while compiling pristine compiler code.

    Both compiler and voting application code would appear pristine, with the the actual hack existing only in the compiled code.

  6. Re:You Think You're Funny by pjt33 · · Score: 3, Insightful
    Or more accurately, half of America is sitting right in the middle, and the other two quarters are on the fringes.
    Right in the middle of America, maybe. From the perspective of those of us on the other side of the Atlantic, your middle is a good way to the right.