Skip to content

Instantly share code, notes, and snippets.

View yxhuvud's full-sized avatar

Linus Sellberg yxhuvud

View GitHub Profile
irb(main):001:0> class A
irb(main):002:1> def foo
irb(main):003:2> puts 'foo'
irb(main):004:2> end
irb(main):005:1> def foo= bar
irb(main):006:2> puts 'bar'
irb(main):007:2> end
irb(main):008:1> end
=> nil
irb(main):009:0> x = A.new
@yxhuvud
yxhuvud / gist:2006599
Created March 9, 2012 13:54
python idiocy. (source: ceder).
# -*- tab-width:4 -*-
def x():
if 1:
if 0:
print "x 12 space"
print "x 1 tab plus 4 space"
# -*- tab-width:8 -*-
def y():
if 1:
class KnightTravails
def initialize size=8
@size = size
@board = Array.new(@size) { Array.new(@size)}
end
def knight_path start_node, end_node, forbidden_nodes
mark_forbidden forbidden_nodes
path = breadth_first_search start_node, end_node