# Castlevania: Lords of Shadow: Pan's Temple puzzle solver by schmid 2012-05-24 moves = [ [-1,+1,-1,"middle RT"], [+1,-1,0,"inner RT"], [0,-1,+1,"outer RT"] ] def apply(move, puzzle) (0..2).each do |n| puzzle[n] = (puzzle[n] + move[n]) % 4 end end random = Random.new 100000.times do puzzle = [1,1,1] # start position (0 is north, 1 is east, etc.) move_list = [] (1..5).each do |m| # shortest solution is 5 moves move = moves[ random.rand(0...moves.length) ] apply(move, puzzle) ; move_list += [ move ] if puzzle == [2,2,2] then # solution is all south puts "solution:" ; move_list.each { |move| puts move[3] } exit end end end
Solution: outer RT x 2, middle RT, inner RT x 2
2012-06-24
2012-06-27
2012-06-30
2012-07-01
2012-07-05
2012-07-06
2012-07-07