Skip to content

Instantly share code, notes, and snippets.

View nhuntwalker's full-sized avatar

Nicholas Hunt-Walker nhuntwalker

View GitHub Profile
Write a function that takes as arguments:
- a list of integers that represents a whole number
--> ex: [1, 2, 3 ,4] = 1234
--> ex: [8, 2] = 82
- a single-digit integer (-9 -> 9)
Return the sum of the whole-number version of the
list of numbers, and that single-digit integer, as a list
add_us([1, 2, 3, 4], -9) --> [1, 2, 2, 5]
The Shell Game
Three (or more) cups. One has a ball underneath, and the rest are empty.
The person running the game will switch the cup positions over and over until they stop.
You, as the gambler, are trying to find which cup still has the ball.
Given the shell that the ball starts under, and a list of swaps, return the location of
the ball at the end.
For example, if my function name is find_the_ball,
and the starting position is 0
Write a function that takes two arguments that are strings
and returns whether or not one is a rotation of the other
word1 = tugboat
word2 =
ttugboa
attugbo
oattugb
boattug
returns True
@nhuntwalker
nhuntwalker / index.html
Last active March 14, 2016 18:23
Project 6: USA vs the World
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Project 6: Visualizing PISA 2012 Data</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js"></script>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<title>A Visualization Makeover</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body></body>
<footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js"></script>