Here’s the updated cgos.rb script. The main change is that the bots are chosen at random (instead of in the order specified).

#!/usr/bin/env ruby
#
# Run bots one after the other on CGOS. The BOTS variable is an array
# if directories of the bots. In each of these directory there has to
# be an executable file called 'cgos.sh' that connects the bot to CGOS.
# This executable is also required to set the sentinel file name to the
# one given in the TERM variable below.

require 'optparse'

# :bot    :: The directory containing you cgos connection script
# :script :: The name of the script (defaults to cgos.sh)
# :games  :: The number of games the bot should play in a row
BOTS = [
  {:bot => "libEGO-AMAF-3"},
  {:bot => "libEGO-AMAF-2"},
  {:bot => "erlygo"},
  {:bot => "libEGO-AMAF-2", :script => "cgos19.sh"},
  {:bot => "libEGO-AMAF-3", :script => "cgos19.sh"},
  {:bot => "erlygo",        :script => "cgos19.sh"}
]
# Sentinel filename to be used by CGOS
TERM     = "stop.txt"
$verbose = false

round       = 0
total_games = 0
games       = Hash.new {|h,k| h[k] = 0}

opts = OptionParser.new
opts.on("-v", "--verbose") { $verbose = true }
opts.on("-s", "--stop") do
  File.new(TERM, "w")
  exit
end

opts.parse(ARGV)

def time
  Time.now.strftime("%H:%M:%S")
end

# Clean up (if script wasn't terminated correctly)
(BOTS+[{:bot => "."}]).each do |bot|
  bot[:games]  = 1         unless bot[:games]
  bot[:script] = "cgos.sh" unless bot[:script]
  Dir.chdir(bot[:bot]) do
    File.delete(TERM) if File.exists?(TERM)
  end
end

until(File.exists?(TERM))
  round += 1
  if (round % 5).zero?
    games.each do |k,v|
      puts "#{sprintf("%03d", v)} games for '#{k}'"
    end
  end
  bot = BOTS[rand(BOTS.length)]
  puts "[#{time}] Running '#{bot[:bot]}' (#{bot[:script]}) for #{bot[:games]} games"
  last_was_print = false
  Dir.chdir(bot[:bot]) do
    IO.popen("./#{bot[:script]} 2>/dev/null") do |pipe|
      until(pipe.eof?)
        line = pipe.gets
        if $verbose
          puts line
          STDOUT.flush
        end
        case line
        when /gameover/
          line =~ /gameover\s+\d\d\d\d-\d\d-\d\d\s+(\S+)/
          print "\n" if last_was_print
          puts "[#{time}] #{$1}"
          last_was_print = false
        when /setup/
          File.new(TERM, "w") if games[bot[:bot]] >= (bot[:games]-1)
          games[bot[:bot]] += 1
          total_games      += 1
          line =~ /setup\s+.*?(\S+\(.*\)\s+\S+\(.*\))/
          print "\n" if last_was_print
          stats = "(game #{games[bot[:bot]]} of #{bot[:games]}, #{total_games} games in total)"
          puts "[#{time}] #{$1} #{stats}"
          last_was_print = false
        when /info/
          unless $verbose
            print "."
            STDOUT.flush
            last_was_print = true
          end
        end
      end
    end
    File.delete(TERM) if File.exists?(TERM)
  end
  round += 1
end
File.delete(TERM)

While playing around with libEGO and trying to see how far I can get with a simple “all-moves-as-first” Monte Carlo bot. I wrote many (well, three) different versions of the same bot and tested them against each other. Of course for a real test I had to use CGOS. But as I only have one computer that I also use for work I had to run the different bots one after the other. To automate that I wrote a small script that lets you run any number of bots in rotation on CGOS.

It’s a very simple script written in Ruby, so you’ll need to have that installed. For the rest see the comments at the beginning of the file.

#!/usr/bin/env ruby
#
# Run bots one after the other on CGOS. The BOTS variable is an array
# if directories of the bots. In each of these directory there has to
# be an executable file called 'cgos.sh' that connects the bot to CGOS.
# This executable is also required to set the sentinel file name to the
# one given in the TERM variable below.

# Number of games for each bot
GAMES = 1
# The bots that should play
BOTS = ["libEGO-AMAF", "libEGO-AMAF-2", "libEGO-AMAF-3"]
# Sentinel filename to be used by CGOS
TERM  = "stop.txt"

round = 0

if ARGV.length > 0 and ARGV.first == "stop"
  File.new(TERM, "w")
  exit
end

# Clean up (if script wasn't terminated correctly)
(BOTS+["."]).each do |dir|
  Dir.chdir do
    File.delete(TERM) if File.exists?(TERM)
  end
end

until(File.exists?(TERM))
  dir = BOTS[round % BOTS.length]
  puts "[#{Time.now}] Round #{round+1}"
  puts "[#{Time.now}] Running '#{dir}' for #{GAMES} games"
  last_was_print = false
  Dir.chdir(dir) do
    games = 0
    IO.popen('./cgos.sh 2>/dev/null') do |pipe|
      until(pipe.eof?)
        line = pipe.gets
        if line =~ /setup/
          games += 1
          File.new(TERM, "w") if games >= (GAMES-1)
        end
        case line
        when /gameover/
          line =~ /gameover\s+\d\d\d\d-\d\d-\d\d\s+(\S+)/
          print "\n" if last_was_print
          puts "[#{Time.now}] #{$1}"
          last_was_print = false
        when /setup/
          line =~ /setup\s+.*?(\S+\(.*\)\s+\S+\(.*\))/
          print "\n" if last_was_print
          puts "[#{Time.now}] #{$1}"
          last_was_print = false
        when /info/
          print "."
          STDOUT.flush
          last_was_print = true
        end
      end
    end
    File.delete(TERM)
  end
  round += 1
end
File.delete(TERM)

Eight programs competed in the main Go event of the 2007 ICGA Tournament, also known as the 12th Computer Olympiad, held in Amsterdam from June 11th to 18th. The winner was MoGo, with seven wins and no losses. Second, with six wins, was CrazyStone, and third, with five wins, GNU Go.

The 9x9 event had ten players, which each played each other twice. The winner with 16 wins was Steenvreter, a new MC/UCT program by Erik van der Werf.

The UCT-based program MoGo, by Yizao Wang, Sylvain Gelly, and others, won both divisions of the March 2007 KGS bot tournament, winning all twelve of its games, and refuting those who thought that MC techniques do not work well for full-sized boards and fast time limits.

The new ICGA web site is a good source of information on past and future ICGA computer games events, including Go. It makes available many game records that were not on the old site.

The 2008 Computer Olympiad is to be held in Beijing, China.

Presents a simple and effective trick to speed depth-first PN-searches.

Move patterns are important to Go-playing programs. This paper by Rémi Coulom presents a new Bayesian technique to learn such patterns, based on a generalized Bradley-Terry model, whose maximum likelihood can be computed efficiently with a minorization-maximization algorithm. Several pattern features may be combined. The model provides a probability distribution over legal moves. It outperforms most previous pattern-learning algorithms. A 19x19 Monte-Carlo program, CrazyStone, that uses these patterns has reached the level of the strongest classical programs.

The UCT-based programs CrazyStone and MoGo, won the Formal and Open divisions respectively of the April 2007 KGS bot tournament. Both programs are based on the UCT algorithm published last September by Kocsis and Szepesvaacute;ri. Their successes, since the publication of UCT, have been striking: they have between them won 15 out of 17 KGS events since September.

The UCT-based programs MoGo and CrazyStone won the Formal and Open divisions respectively of the April 2007 KGS bot tournament. Both programs use UCT. CrazyStone also implements an improvement to UCT, which its authors have not yet published.

The 12th World Computer Olympiad will be held in Amsterdam, from June 11th to 18th. It will include 19x19 and 9x9 Go.

housebot-logo-small.pngToday was the January 2007 KGS bot tournament and version 0.5 of HouseBot managed to get on the 7th of 10 places. What’s even more noteworthy is that it managed to beat version 0.4 which is a first. That’s probably due to the improved search (a Transposition Table was introduced) and due to some minor enhancements in Life & Death analysis (the first step beyond Benson).

The next goal will be to beat 0.4 consistently and retire it completely. I hope this will be possible until next months tournament.

housebot-logo-small.pngToday was the January 2007 KGS bot tournament and version 0.5 of HouseBot managed to get on the 7th of 10 places. What’s even more noteworthy is that it managed to beat version 0.4 which is a first. That’s probably due to the improved search (a Transposition Table was introduced) and due to some minor enhancements in Life & Death analysis (the first step beyond Benson).

The next goal will be to beat 0.4 consistently and retire it completely. I hope this will be possible until next months tournament.

housebot-logo-small.pngToday was the January 2007 KGS bot tournament and version 0.5 of HouseBot managed to get on the 7th of 10 places. What’s even more noteworthy is that it managed to beat version 0.4 which is a first. That’s probably due to the improved search (a Transposition Table was introduced) and due to some minor enhancements in Life & Death analysis (the first step beyond Benson).

The next goal will be to beat 0.4 consistently and retire it completely. I hope this will be possible until next months tournament.

In the 22nd KGS Computer Go Tournament, MoGoBot was undefeated winner of the formal (9x9) division, and MoGoBot13 was undefeated winner of the open (13x13) division.

Introduces a new algorithm, UCT, that applies bandit ideas to to Monte-Carlo tree searches.

Common Lisp Go Framework is my current hobby project. It should be both a program that plays Go as well as a platform for devoloping other such programs. Also, there are some plans to add an “intelligent” Go-problem-collection. What we have until now:

  • board representation as simple array
  • variation tree as directed acyclic graph
  • a monte-carlo player that uses the UCT-Algorithm (simple, slow and bad)
  • GTP-support in progress to play on servers like KGS or CGOS
  • an algorithm that keeps track of the best human-given variation so far when end-node-evaluations are also told - this could be used in the wiki-like Go-problem-library

If you’re interested, just grab the current source via subversion and give me some feedback!

From the thousands of languages out there, only a few should be considered “innovative” in a sense that they really did something new, something that changes the way you program.

DISCLAIMER: Probably not a 100% of the features below were really invented by the language I associate it with - if you find such an error, please tell me..

You know I’m quite the Lisp man, so let’s start with its innovations:

  • Functional programming
  • Incremental Development, changing running Systems
  • Code as Data, Macro programming, DSL’s
  • “Syntax is Evil”
  • Garbage Collection
  • Multimethods, MOP

Let’s save discussion of the syntax-thesis for a future post..

Other languages:

  • Smalltalk
    • IDE belongs to the language
    • Don’t edit text files, but change persistent objects…
    • Not OOP in general (belongs to Simula I think)
  • Erlang
    • Message-Passing Concurrency
    • Super-lightweight threads
    • I’d call it the first Agent-Oriented Programming Language
  • Haskell
    • “Side Effects are Evil”, do all dirty stuff in Monads (too bad I never understood them really…)
    • Currying is great (I’m getting hungry now)
    • ML Type inference also rocks, but that’s not a Haskell achievement
  • Prolog
    • Relations are more powerful than functions (although this is clear mathematically)
    • Unification rocks (probably also not invented here)
  • Self
    • Prototype Object Systems are nice, e.g. the singleton pattern shows that something is strange with “normal” object systems that don’t support single objects from scratch
  • Setl
    • Use sets everywhere you can, this makes more concise programs and gives good parallelization

I’m sure I forgot a lot of languages/features - but which?

Finally, WordPress is configured and I can start to spam the web with my thoughts…

About

Planet Computer-Go is an aggregation of public weblogs written by members of the Computer Go community. To get your blog aggregated contact Urban Hafner.

Topics

Last updated at August 28, 2008 02:15 PM.