The game of Reversi is very simple -- the rules can be found here:

http://en.wikipedia.org/wiki/Reversi

Write a program that takes a text file with:

  • One line with the word "WHITE" or "BLACK", which determines who makes the next move
  • 8 lines of the board, with "W" = white, "B" = black, and "." = empty

Compute the score and final board position of the following game, given optimum play on both sides.

BLACK
..WWBB..
.WWWWBBB
BWWBWWBB
BBWWWWWB
BWWWWWWW
BWWBWBW.
BWWWBW..
..WWWW..

You can use any of the following languages:

  • PHP
  • Perl
  • Python
  • Ruby
  • C/C++
  • C#
  • Java/Scala/Clojure
  • Ocaml/SML/F#
  • Haskell
  • Lisp/Scheme
  • Malbolge

(PHP or Java are what we use here, but we love playing with all sorts of technology, so pick whatever you want).

Attach your solution to your resume and send it to:

0x41444b4b5d545b5e5342 @ gaiaonline.com

where every byte is the ASCII character xor 0x31.