module Shuriken::TacticsCaparandom
Constants
- ANTITACTICS
- TACTICS
Public Class Methods
antitactics()
click to toggle source
# File lib/shuriken/tactics_caparandom.rb, line 37 def TacticsCaparandom.antitactics puts "~~~ antitactics ~~~" score, total = 0, 0 ANTITACTICS.each do |tactic| engine = Shuriken::EngineCaparandom.new("caparandom") engine.printinfo = false engine.board.use_fen(tactic[0]) #engine.time = 25 result = engine.think total += 1 score += 1 if tactic[1] != result puts "#{total}. move #{result} | " + (tactic[1] != result ? "ok" : "error") end puts "= #{score} / #{total}" end
run()
click to toggle source
# File lib/shuriken/tactics_caparandom.rb, line 32 def TacticsCaparandom.run TacticsCaparandom.antitactics TacticsCaparandom.tactics end
tactics()
click to toggle source
# File lib/shuriken/tactics_caparandom.rb, line 53 def TacticsCaparandom.tactics puts "~~~ tactics ~~~" score, total = 0, 0 TACTICS.each do |tactic| engine = Shuriken::EngineCaparandom.new("caparandom") engine.printinfo = false engine.debug = false engine.board.use_fen(tactic[0]) engine.time = 100 result = engine.think total += 1 score += 1 if tactic[1] == result puts "#{total}. move #{result} | " + (tactic[1] == result ? "ok" : "error") # return end puts "= #{score} / #{total}" end