class Shuriken::Engine

Constants

RESULT_BLACK_WIN
RESULT_DRAW
RESULT_WHITE_WIN

Public Instance Methods

history_remove() click to toggle source
# File lib/shuriken/engine.rb, line 27
def history_remove
        @board = @history.remove
end
history_reset() click to toggle source
# File lib/shuriken/engine.rb, line 23
def history_reset
        @history.reset
end
history_undo() click to toggle source
# File lib/shuriken/engine.rb, line 31
def history_undo
        @board = @history.undo
end
init_mate_bonus() click to toggle source
# File lib/shuriken/engine.rb, line 14
def init_mate_bonus
        @mate_bonus = [1] * 100
        (0..20).each { |i| @mate_bonus[i] += 20 - i }
        @mate_bonus[0] = 50
        @mate_bonus[1] = 40
        @mate_bonus[2] = 30
        @mate_bonus[3] = 25
end
move_list() click to toggle source
# File lib/shuriken/engine.rb, line 43
def move_list
        mgen = @board.mgen_generator
        moves, i = mgen.generate_moves, 0
        moves.each do |board|
                i += 1
                puts "#{i} / #{board.move_str} / #{board.score}"
        end
end
print_move_list(moves) click to toggle source