#include "spielfeld.h"

using namespace std; // für iostream

///////////////////////////////////////////////////////////////////////////////
void SpielfeldAnzeigen(const Spielfeld & feld) {                             //
///////////////////////////////////////////////////////////////////////////////
  // Das kann man bestimmt auch schöner machen ...
  // ist so aber für beliebige Werte MAX_Spieler funktionsfähig
  int i,j;
  cout << "Aktuelle Belegung des Spielfelds:" << endl;
  // erst die Startbereiche
  for(i=0;i<MAX_Spieler;i++) {
    for(j=0;j<feld.start[i];j++) {
      cout << i+1; // +1, Spielernummern so 1,...,4
    }
    for(;j<11;j++) {
      cout << ' ';
    }
  }
  cout << endl;
  // nun das Spielfeld in 10er Abschnitten
  for(i=0;i<MAX_Spieler;i++) {
    cout << ' ';
    for(j=0;j<10;j++) {
      cout << 1+feld.besetzt[i*10+j];
    }
  }
  cout << endl;
  // und die Zielbereiche
  for(i=0;i<MAX_Spieler;i++) {
    for(j=0;j<4;j++) {
      if (feld.ziel[i][j]) {
	cout << i+1; // +1, Spielernummern so 1,...,4
      } else {
	cout << 0;
      }
    }
    cout << "       "; // 7 Blanks
  }
  cout << endl;
}
