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
# Recursive backtracking algorithm for maze generation. Requires that | |
# the entire maze be stored in memory, but is quite fast, easy to | |
# learn and implement, and (with a few tweaks) gives fairly good mazes. | |
# Can also be customized in a variety of ways. | |
DIRS = (N, S, E, W = 1, 2, 4, 8) | |
DX = { E => 1, W => -1, N => 0, S => 0 } | |
DY = { E => 0, W => 0, N => -1, S => 1 } | |
OPPOSITE = { E => W, W => E, N => S, S => N } |
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
# Spec Step 1 | |
describe CoinChanger do | |
it "should return a penny" do | |
CoinChanger.make_change(1).should == %w(p) | |
end | |
end | |
# Class Step 1 - after failed uninitialized constant, failed no method errors, failed wrong number of arguments and | |
# failed 'got nil expected ["p"]' | |
class CoinChanger |
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
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
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
<h2>Antispam</h2> | |
<p>Email me at <span class="antispam">scott at-symbol robbin dot co</span></p> |
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
require "test/unit" | |
####################################################### | |
# | |
# Your code starts on line 20. | |
# | |
# To run the tests from your command line: | |
# | |
# > rake | |
# |
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
def foo(a=:default, b) | |
puts "a=#{a}, b=#{b}" | |
end | |
foo(:value) | |
foo(:x, :y) |