This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn scary-people | |
"Go `n` levels deep into the \"Normal people scare me\" shirt" | |
[n] | |
(loop [n n | |
ret "Normal people scare me" | |
quotes (if (odd? n) \" \')] | |
(if (zero? n) | |
ret | |
(recur (dec n) | |
(str "Normal people wearing " quotes ret quotes " shirts scare me") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `pushd` and `popd`-style commands for git branches (in the place of directories) | |
# USAGE: `pushb <branch>; SOME_WORK; popb` | |
GITSTACK=() # stack of branches–just an array that we add to and access from the tail | |
GITSTASHCK=() # stack of stashes | |
function pushb { | |
GITSTACK+=`git symbolic-ref --short HEAD` | |
GITSTASHCK+=`git stash create` | |
git reset --hard # `git stash create` doesn't do this the way `git stash` normally does | |
git checkout $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From Udacity's Software Testing class (problem set 3, problem 1) | |
# | |
# SPECIFICATION: | |
# | |
# check_sudoku() determines whether its argument is a valid Sudoku | |
# grid. It can handle grids that are completely filled in, and also | |
# grids that hold some empty cells where the player has not yet | |
# written numbers. | |
# | |
# First, your code must do some sanity checking to make sure that its |