Obfuscated Vote Counting Contest 223
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."
I WIN! (Score:5, Funny)
Damn (Score:5, Funny)
Gah (Score:1, Funny)
Re:I WIN! (Score:2, Funny)
Re:I WIN! (Score:4, Funny)
Patent pending (Score:5, Funny)
Beware of Diebold suing you for infringing one of their patents !
Re:last election (Score:0, Funny)
Re:Summary of this year's election (Score:5, Funny)
Re:I WIN! (Score:1, Funny)
enum {
BUSH;
KERRY;
NADER;
YADA_YADA;
} Candidates;
int main (int argc, char **argv)
{
FILE *fd;
int c;
int bush = 0, kerry = 0, nader = 0, yada_yada = 0;
fd = fopen("ballots.str");
while ((c = getc(fd)) != EOF) {
switch (c) {
case BUSH:
bush += 1;
break;
case KERRY:
kerry += 1;
break;
case NADER:
nader += 1;
break;
case YADA_YADA:
yada_yada += 1;
break;
}
}
printf("And the winner is BUSH!\n", w);
return 127;
}
ok. (Score:5, Funny)
int KerryVotes=0;
int BushVotes=0;
void ParseVote(const char* v) {
if(!strcmp(v,"Kerry")) {
KerryVotes++;
} else if(strcmp(v,"Bush")) {
BushVotes++;
}
}
my submission (Score:5, Funny)
Re:last election (Score:5, Funny)
Only newbie programmers use new lines and carriage returns.
Real programmers don't use new lines and carriage returns as it detracts from being able to glance at the whole program at once and immediately understand it's intent, purpose, and spot any bugs in a holistic fashion.
Re:last election (Score:2, Funny)
In addition to the mistakes others noticed: what's an elsif?
Re:ok. (Score:3, Funny)
Re:Nader not Nater (Score:3, Funny)
And they both have the same chances of becoming president.
Re:I WIN! (Score:5, Funny)
And, I'm sure Bush would believe he really does have that much more "support" from "his" citizens than Kerry.
Re:ok. (Score:3, Funny)
Re:And while you're hacking away... (Score:3, Funny)
>
> In fact, just forget to vote alltogether, not like your vote counts, right?
I dunno, I'd think that being able to hack the best-hidden trapdoor into the voting system would make your vote count for quite a bit!
STALLMAN-BALMER 2008!
C code? (Score:3, Funny)
C code that appears correct but does the wrong thing when counting votes.
Does it have to be a C code? In my opinion C is not nearly obfuscatable enough. What about BF [muppetlabs.com] or Unlambda [eleves.ens.fr]? Or, better yet, Lingua Romana Perligata [cpan.org]? Now when I'm thinking about it, I think PASM [slashdot.org] might be perfect for such a task, if only-- I know! Acme DWIM [cpan.org] or Bleach [cpan.org] compiled directly into PASM! With JIT!! Dear God, that would be so cool!!! But wait, they want C code, right... Wait a minute, Perl is written in C! So is Parrot! And they can be embedded in a C program! Sweet Heavens! What an idea!!!1 Gotta go.
Re:Course at Rice (Score:3, Funny)
Re:What size processor will this code run on? (Score:3, Funny)
> if (vote==candidate_1)
> candidate_1_count++;
>
> On an 32-bit machine, this will count up to 2 billion votes before the counter rolls over and goes negative. On a 16-bit machine, 32,000 votes. On an 8-bit machine, 127 votes. So, if I'm a Democrat, I'll make sure to put 16-bit versions of this machine in precincts such as East Buttfuck, Texas, which has a popuation of around 25000.
Likewise, if I'm a Republican, I'll put a 16-bit version of this machine in inner city areas with populations ranging from 18000 to 50000.
And if I'm really smart, I'll change the sizeof() an int to 15 or 17 depending on the number of votes I want to count, and the number I want to overflow. Spinning it to computer-illiterate civic officials would be as simple as having my salesguy say either "Because you have more people to count up, you get the 17-bit version. It's one better than the 16-bit version, but we can offer it to you at the same price", or "We'll let you save $500 per unit by going to the 15-bit version, which is suitable for smaller districts such as yours."
Re:I WIN! (Score:2, Funny)
C is for wimps (Score:1, Funny)
Re:I WIN! (Score:3, Funny)
Re:I WIN! (Score:5, Funny)
Aww c'mon, give the guy a break already!
--
free gmail invites -- only one left! [slashdot.org]
Leaked Diebold Code (Score:2, Funny)