Skip to content

Instantly share code, notes, and snippets.

Pressman - "Chess where everything is a queen"

The objective of this game is to remove all of your opponent's pieces from the board.

Preparing the Board

The game requires two players, a board, and thirty-two pieces. There should be two colors of pieces, sixteen pieces of each color.

For the rest of this document, we will assume that one color of pieces is black, and that the other color is white.

@stuartellis
stuartellis / Modules as Plugins
Created February 10, 2011 19:09
Code sample for using Ruby modules as plugins
#!/usr/bin/env ruby -wKU
class Item
attr_accessor :title
def initialize(title)
@title = title
end
end
@stuartellis
stuartellis / gist:657305
Created October 31, 2010 23:24
Possible solution to Euler problem 5
#!/usr/bin/env ruby -wKU
class Application
def test(input)
pass = false
(1..20).each do |number|
if input % number == 0
@stuartellis
stuartellis / gist:629646
Created October 16, 2010 10:20
A solution to the URL Splitter problem
# A solution to: http://sites.google.com/site/tddproblems/all-problems-1/URL-splitting
class UrlSplitter
def self.split(url)
match = url.match /(\w+):\/\/([^\/]+)(\/|$)(.*)?/
results = {:protocol => match[1], :domain => match[2]}
if match[4] == ""
results[:path] = nil
else
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque rutrum ligula mi, nec volutpat nibh. Cras non urna massa, eu sollicitudin ligula. Donec nec lacinia est. Nulla odio risus, laoreet id blandit ac, condimentum at ipsum. Proin eu quam risus. Mauris quis arcu volutpat risus interdum hendrerit. Morbi id risus risus, ut condimentum lorem. Suspendisse venenatis eros enim. Sed quis aliquam nunc. Ut eget erat lorem.
Curabitur tincidunt, purus eget ornare volutpat, elit leo laoreet ante, nec tincidunt ligula neque et nunc. Donec ultrices viverra euismod. Pellentesque ut vulputate odio. Fusce ut mi eget tortor imperdiet semper feugiat a lorem. In hac habitasse platea dictumst. Etiam in ligula a felis laoreet vulputate nec at elit. Cras ut velit eget tellus tempor imperdiet id a justo. Suspendisse at metus dolor, a pretium nisl. Vivamus varius posuere porttitor. Proin ullamcorper, tortor convallis semper eleifend, justo enim suscipit risus, eu sagittis mauris nisi eget lorem. Etiam in fringilla ante. Nam
#!/usr/bin/env ruby -wKU
puts `ps -o rss= -p #{$$}`.to_i
current_fib = 1
fib_numbers = []
for i in 1..4000000 do
if i == current_fib * 2
fib_numbers << i
rake gemspec:validate --trace
(in /Users/se/Downloads/glyph)
** Invoke gemspec:validate (first_time)
** Invoke version_required (first_time)
** Execute version_required
** Execute gemspec:validate
glyph.gemspec is invalid. See the backtrace for more details.
rake aborted!
undefined method `prerelease?' for nil:NilClass
["book/output/html5/glyph.html", "book/output/html5/images/document_generation.png", "book/output/html5/images/glyph.png", "book/output/html5/images/glyph.svg", "book/output/html5/styles/default.css", "book/output/html5/styles/lazy.css", "book/output/html5/styles/ultraviolet/lazy.css"] are not files
/Users/se/.rvm/gems/ruby-1.8.7-p299@jruby_quickstart/bundler/gems/glyph-452af36/lib/glyph/commands.rb:44:in `+'
/Users/se/.rvm/gems/ruby-1.8.7-p299@jruby_quickstart/bundler/gems/glyph-452af36/lib/glyph/commands.rb:44
/Users/se/.rvm/gems/ruby-1.8.7-p299@jruby_quickstart/gems/gli-1.1.1/lib/gli/command.rb:71:in `call'
/Users/se/.rvm/gems/ruby-1.8.7-p299@jruby_quickstart/gems/gli-1.1.1/lib/gli/command.rb:71:in `execute'
/Users/se/.rvm/gems/ruby-1.8.7-p299@jruby_quickstart/gems/gli-1.1.1/lib/gli.rb:117:in `run'
/Users/se/.rvm/gems/ruby-1.8.7-p299@jruby_quickstart/bundler/gems/glyph-452af36/bin/glyph:7
/Users/se/.rvm/gems/ruby-1.8.7-p299@jruby_quickstart/bin/glyph:19:in `load'
/Users/se/.rvm/gems/ruby-1.8.7-p299@jruby_quickstart/bin/glyph:19
error: can't convert nil into String