Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Magic election stealing code!

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
ZombieNixon Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 05:46 PM
Original message
Magic election stealing code!
Edited on Wed Sep-28-05 06:22 PM by ZombieNixon
enum
{
CANDIDATE_REPUB,
CANDIDATE_DEM
};

void Count(void)
{
long votes, demVotes, repVotes;
Byte vote;

vote = getch();

if (vote == CANDIDATE_DEM) demVotes++;
if (vote == CANDIDATE_REPUB) repVotes++;

votes = demVotes+repVotes;

if (demVotes > repVotes)
demVotes = votes * .49;
repVotes = votes *.51;

printf("We got a MAN-date!!!!!\n");
}

Should I run for public office now (as a Republican, of course)?
Printer Friendly | Permalink |  | Top
LSK Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 05:51 PM
Response to Original message
1. C++?
Printer Friendly | Permalink |  | Top
 
ZombieNixon Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 05:53 PM
Response to Reply #1
2. C
C++ would be mostly the same, except the last line would look something like

cout<< "We got a MAN-date!!!" << nl;
Printer Friendly | Permalink |  | Top
 
AirmensMom Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 05:54 PM
Response to Original message
3. That's good.
:toast:
Printer Friendly | Permalink |  | Top
 
ZombieNixon Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 05:56 PM
Response to Reply #3
4. WARNING: Line 10 (var "vote" is not initialized before being used)
:evil grin:
Printer Friendly | Permalink |  | Top
 
Ratty Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 06:18 PM
Response to Reply #4
8. Isn't it?
Byte vote; Bigger problem is the CANDIDIATE_DEM, but that could be a subtle trick, eh? How about:

if (vote == CANDIDATE_DEM) demVotes++;
if (vote = CANDIDATE_REPUB) repVotes++;
Printer Friendly | Permalink |  | Top
 
ZombieNixon Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 06:22 PM
Response to Reply #8
9. Damn you for catching my spelling errors!
Truth is, code to steal votes is really very simple. What I have above is probably at least two-thirds of all you would need.
Printer Friendly | Permalink |  | Top
 
BrewerJohn Donating Member (499 posts) Send PM | Profile | Ignore Wed Sep-28-05 06:10 PM
Response to Original message
5. Line 16: Error: case statements missing from switch
Should be

switch (vote)
{
case CANDIDATE_DEM:
demVotes++;
break;
case CANDIDATE_REPUB:
repVotes++;
break;
default:
trash(vote); // this is a two-party system, dammit! Who cares what you think?
}

(Or you could just drop the switch)
Printer Friendly | Permalink |  | Top
 
ZombieNixon Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 06:14 PM
Response to Reply #5
6. Whoops! Better lose the switch.
Printer Friendly | Permalink |  | Top
 
Name removed Donating Member (0 posts) Send PM | Profile | Ignore Wed Sep-28-05 06:18 PM
Response to Original message
7. Deleted message
Message removed by moderator. Click here to review the message board rules.
 
ZombieNixon Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-28-05 06:25 PM
Response to Reply #7
10. Casino code?
void MakeTheSuckerPay(int myCash)
{
int myBet;

printf("Sorry, you lose.");
myCash -= myBet;

printf("Play again? (Y/N)")

switch(getch())
{
case 'Y':
case 'N':
default:
MakeTheSuckerPay();
break;
}
}
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Thu Dec 26th 2024, 09:40 AM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC