module RubyShogi::Zobrist

Constants

HASH

Public Class Methods

get(n) click to toggle source
# File lib/ruby_shogi/zobrist.rb, line 20
def Zobrist.get(n)
        HASH[n]
end
init() click to toggle source
# File lib/ruby_shogi/zobrist.rb, line 12
def Zobrist.init
        return if HASH.length > 0
        10_000.times do |i|
                HASH.push(rand(1024) | (rand(1024) << 10) \
                                | (rand(1024) << 20) | (rand(1024) << 30) | (rand(1024) << 40))
        end
end