summaryrefslogtreecommitdiff
path: root/bindings/ruby/test2_selfplay.rb
diff options
context:
space:
mode:
authorMartin DeMello <mdemello@google.com>2019-02-09 18:11:01 -0800
committerJohn Fultz <jfultz@wolfram.com>2019-07-22 02:04:47 -0700
commitd2b078ad15fcadb5de8ef25b8f19bde613f59a41 (patch)
treef1b09cb1b84e905e4f5d25522988661e8f7e078d /bindings/ruby/test2_selfplay.rb
parent46b021d888463e91f86d9c031e2f417256f89e58 (diff)
add support for board configuration
Diffstat (limited to 'bindings/ruby/test2_selfplay.rb')
-rw-r--r--bindings/ruby/test2_selfplay.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/bindings/ruby/test2_selfplay.rb b/bindings/ruby/test2_selfplay.rb
index 33d08ce..253345e 100644
--- a/bindings/ruby/test2_selfplay.rb
+++ b/bindings/ruby/test2_selfplay.rb
@@ -1,7 +1,18 @@
require_relative 'quackle_runner'
+# Allow a board file to be passed in on the command line
+if ARGV[0]
+ b = IO.read(ARGV[0])
+ board = Quackle::BoardUtils::read_board_params(
+ b, doublespaced: true, piped: true)
+else
+ # use the default empty board
+ board = nil
+end
+
runner = Quackle::AIRunner.new(
- lexicon: 'twl06', alphabet: 'english', datadir: '../../data', random_seed: 42)
+ lexicon: 'csw15', alphabet: 'english', board: board,
+ datadir: '../../data', random_seed: 42)
runner.init_game([["Compy1", :speedy],
["Compy2", :speedy]])