Skip to content

Instantly share code, notes, and snippets.

@joesavak
Created January 10, 2012 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joesavak/1591725 to your computer and use it in GitHub Desktop.
Save joesavak/1591725 to your computer and use it in GitHub Desktop.
how to run for president
#gotta be insane to do this, and american and 35 or older
if self.sane || !self.american || self.age < 35
exit(1)
end
#assumes all affairs will become public by the time the election is over
affair-factor = (all_affairs - repented_affairs) * -1
#if your religion isn't that of our founding fathers- you have problems.
if self.religion == public.perceived_founding_father_religion
religion_factor = 10
else
religion_factor = 0
end
#New code for this election! Don't be Santorum
if self.google_result == campaign_page
google_factor = 10
else
google_factor = 0
end
#the more pacs you have, the better
pac_factor = self.num_pacs
#New code again! Don't be Perry
if self.debate_skills == low
debate_factor = 0
else
debate_factor = 10
end
charm_factor = self.charm
money_factor = self.private_jets
#stack them all up
self.score = affair_factor +
religion_factor +
google_factor +
pac_factor +
debate_factor +
charm_factor +
money_factor
#then determine the winner
num_candidates = 0
sum_scores = 0
@candidates.each do |c|
num_candidates++
sum_scores += c.score
end
your_chances = self.score/sum_scores
#Good luck!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment