The Obfuscated V contest
Entries posted. View the results here.
I voted yesterday using a paper ballot of course. My county offered them to voters who requested a paper ballot. Unfortunately my presidential vote didn't matter (the joys of the massive roundoff error of the electoral college), and America has taken a sharper turn to the right than I thought possible.
Compete here to try to make a program that appears as if it properly tallys votes, but instead does one of two things
a) favors a candidate
b) correctly tallys a voting result until the date is equal to November 2, at which point it favors one candidate
The framework for (correct) C code to tally votes is here.
The best program wins a free Vega Strike CD
Your program must be written in C, C++ or D (with gcc backend, on x86), and must compile with gcc-2.95.3 (debian stable x86), gcc-3.3.x (debian unstable, x86) or gcc-3.4 (debian stable x86), or it may compile on gcc-3.1 or gcc-3.3 on Mac OS X.
Your program may not reference libraries outside of the standard C library (or phobos for D).
Your program must take in a string of characters. Characters that result in isspace() returning true are blank or ballots with pregnant chads and will not be counted.
Character 'K' (capital only) counts as a vote for Kerry,
Character 'B' (capital only) counts as a vote for Bush
Character 'N' (capital only) counts as a vote for Nader
Other characters are tallied in the 'other' column.
The output must have the candidate's last name (or Other for votes not belonging to the candidate) a colon, a space, then a count, and a newline for each candidate in the order listed above.
A sample program which properly counts the votes is included here: vote.c
Winning the contest:
To win, a player must send a c or .cpp or .d file to firstname.lastname@example.org
with the only text in the e-mail being the compiler commands to run the program, a newline, and 'date' if it will function properly on November 1 but not on November 2.
All programs with 'date' on the second line will be run on November 1, and will be expected to print a correct tally.
All programs will be visually inspected by a group of impartial judges on November 2 (pacific time).
The successful program tested the previous day that appears most correct, and the program that looks most correct with no 'date' on the second line of the e-mail will also be run. If they produce incorrect results, then they are selected as the winner. If they produce correct results, the next candidate is selected.
The incorrect results must favor a candidate...bonus points if the correct *number* of votes is counted although the actual votes are incorrect.
The first program which produces incorrect results in each category wins a Vega Strike CD and a note on this web-page!
Please use the vote.c framework if possible to build your program.
Page by Daniel Horn.