Skip to content

Instantly share code, notes, and snippets.

@int03e
int03e / gist:2576298
Created May 2, 2012 12:43
8-puzzle solver
@original_state = [1,2,3,0,6,4,8,7,5] # input data
class EightPuzzle
attr_reader :goal
def initialize
@nsize = 3
@tsize = 3**2
@goal = [1,2,3,8,0,4,7,6,5]
end
@int03e
int03e / gist:2576155
Created May 2, 2012 12:12
eight puzzle solver (ruby)
@original_state = [1,2,3,0,6,4,8,7,5] # input data
class EightPuzzle
attr_reader :goal
def initialize
@nsize = 3
@tsize = 3**2
@goal = [1,2,3,8,0,4,7,6,5]
end
@int03e
int03e / gist:2576139
Created May 2, 2012 12:11
eight puzzle solver (ruby)
@original_state = [1,2,3,0,6,4,8,7,5] # input data
class EightPuzzle
attr_reader :goal
def initialize
@nsize = 3
@tsize = 3**2
@goal = [1,2,3,8,0,4,7,6,5]
end