{{ message }}

Instantly share code, notes, and snippets.

🕺

# Dan Murphy Murphydbuffalo

🕺
Created Jun 1, 2014
Solution to the whiteboard mini-challenge (OOD reading)
View whiteboard.rb
This file contains 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
 class Whiteboard attr_accessor :contents def initialize(contents = []) @contents = contents end def erase_whiteboard @contents = []
Last active Aug 29, 2015
Solution to the mortgage calculator challenge
View calculator.rb
This file contains 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
 class Mortgage attr_reader :principal, :down_payment_percentage, :apr, :duration_in_years def initialize(principal, down_payment_percentage, apr, years) @principal = principal @down_payment_percentage = down_payment_percentage @apr = apr @duration_in_years = years end
Created Jun 19, 2014
Guess the number
View guess.js
This file contains 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
 function getInput() { prompt('Please guess a number between 1 and 100.'); } var name = prompt('Welcome! What\'s your name?'); var secretNumber = (Math.floor(Math.random() * 100) + 1); while(!name.length > 0) { name = prompt("Enter something for a name :)")
Created Jun 19, 2016
The final countdown
View countdown.exs
This file contains 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
 defmodule Countdown do def from(number, phrase \\ 'Aww shucky ducky!') do Stream.iterate(number, &(&1 - 1)) |> Enum.take(number + 1) |> Enum.map( fn 0 -> say(phrase) number -> say(number) sleep(1) end )
Last active Feb 7, 2020
Great (free!) computer science and programming explainers
View resources.markdown