/* * Gnome Nine Mens Morris * Written by Dirk Farin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "util.hh" #include #include using namespace std; static char piece_displ[3] = { 'O','.','X' }; static char* pc = &piece_displ[1]; ostream& operator<<(ostream& ostr ,const Board& b) { ostr << " 2\n"; ostr << " 1 " << pc[b.board[16]] << " --------- " << pc[b.board[17]] << " --------- " << pc[b.board[18]] << " 3\n"; ostr << " | | |\n"; ostr << " | " << pc[b.board[8]] << " ----- " << pc[b.board[9]] << " ----- " << pc[b.board[10]] << " |\n"; ostr << " | | | | |\n"; ostr << " | | " << pc[b.board[0]] << " - " << pc[b.board[1]] << " - " << pc[b.board[2]] << " | |\n"; ostr << " | | | | | |\n"; ostr << " 8 " << pc[b.board[23]] << " - " << pc[b.board[15]] << " - " << pc[b.board[7]] << " " << pc[b.board[3]] << " - " << pc[b.board[11]] << " - " << pc[b.board[19]] << " 4\n"; ostr << " | | | | | |\n"; ostr << " | | " << pc[b.board[6]] << " - " << pc[b.board[5]] << " a " << pc[b.board[4]] << " | |\n"; ostr << " | | | | |\n"; ostr << " | " << pc[b.board[14]] << " ----- " << pc[b.board[13]] << " b---- " << pc[b.board[12]] << " |\n"; ostr << " | | |\n"; ostr << " 7 " << pc[b.board[22]] << " --------- " << pc[b.board[21]] << " c-------- " << pc[b.board[20]] << " 5\n"; ostr << " 6\n"; ostr << "ply: " << b.ply << " white (X): " << ((int)b.n_white) << " black (O): " << ((int)b.n_black) << endl; ostr << "next: " << ((b.next==WHITE) ? "white" : "black") << endl; return ostr; }