Skip to content

Instantly share code, notes, and snippets.

View kma3a's full-sized avatar

Kelsey Ando kma3a

View GitHub Profile
@kma3a
kma3a / jquery_example.html
Last active August 29, 2015 13:55 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
@kma3a
kma3a / 0.2.1-boggle_class_from_methods.rb
Last active December 31, 2015 21:18 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
class BoggleBoard
def initialize(board)
@board = board
end
def access_coord(row_num, col_num)
@board[row_num][col_num]
end
(Intermediate): Ranked Voting System
http://www.reddit.com/r/dailyprogrammer/comments/1r2mcz/112013_challenge_136_intermediate_ranked_voting/
A Ranked Voting System is a system that chooses a result based on a ranked-preference rather than a simple majority. A standard ranked ballot generally has multiple choices, only one of which one can be picked. A ranked ballot allows you to choose the order in which you prefer candidates. An example could be that you prefer choice B first, then choice C, and finally choice A.
There are some neat implications on how this differs from conventional voting systems, and is used in many different countries and states (check out the same article's list of current uses on the overall system; well worth a watch! The overall difference between the two system is that a more agreed-upon candidate could win during a heavily split election.
Your goal is to take a list of candidates and voter's ballots, implement this voting system (using the Instant-runoff rules), and print the