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
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 |
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
# -*- 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: |
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 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 |
NewerOlder