artificial intelligence in board games Scala code