Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fehlersuche
  • Loading branch information
unknown authored and unknown committed Jun 2, 2012
commit 23bd189f8c3afa33dcc318d4eefa6e0c326431ab
Binary file modified Chess/Debug/Chess.exe
Binary file not shown.
Binary file modified Chess/Debug/Interface/interface.o
Binary file not shown.
Binary file modified Chess/Debug/Piece/bauer.o
Binary file not shown.
Binary file modified Chess/Debug/Piece/piece.o
Binary file not shown.
Binary file modified Chess/Debug/chess.o
Binary file not shown.
Binary file modified Chess/Debug/game/game.o
Binary file not shown.
20 changes: 8 additions & 12 deletions Chess/Interface/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,30 @@
*/

#include "interface.h"
#include "../game/brett.h"
#include <iostream>
#include <string>

void Interface::einlesen(int p)
{
std::cout << "Spieler " << p << ": Bitte Zug eingeben: ";
std::cin.getline(e,6);

/*char c;
int i;
char e;
int f;
std::cin >> c >> i >> e >> f;

i = 42;*/


//std::cin >> p1a >> p1b >> p2a >> p2b;
p1a='e';
p2a='e';
p1b=2;
p2b=4;
}

void Interface::ausgabe(char (*f)[8])
void Interface::ausgabe(brett* b)
{
std::cout << " a b c d e f g h" << std::endl << " ---------------" << std::endl;
for (int i=0;i<8;i++)
{
std::cout << 8-i << "|";
for (int j=0;j<8;j++)
{
std::cout << f[i][j] << " ";
std::cout << b->lese(j,i) << " ";
}
std::cout << std::endl;
}
Expand Down
6 changes: 4 additions & 2 deletions Chess/Interface/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
#define INTERFACE_H_

#include <string>
#include "../game/brett.h"

class Interface
{
public:
void ausgabe(char (*f)[8]);
void ausgabe(brett* b);
void einlesen(int p);

char e[6];
char p1a,p2a;
int p1b,p2b;
};


Expand Down
15 changes: 7 additions & 8 deletions Chess/game/brett.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
* Author: Thomas
*/

#include "brett.h"
#include <iostream>

#include "brett.h"

brett::brett() {

Expand All @@ -29,9 +28,9 @@ char brett::lese(int x,int y)
{
if ((x>=0) && (x<8) && (y>=0) && (y<8))
{
//int val=x+8*y;
//char z=f[val]; // --> geht nicht, warum????
//return z;
int val=x+8*y;
char z=f[val]; // --> geht nicht, warum????
return z;
}
return '-';
}
Expand All @@ -40,7 +39,7 @@ bool brett::schreibe(int x,int y,char value)
{
if ((x>=0) && (x<8) && (y>0) && (y<8))
{
//f[x+8*y]=value;
f[x+8*y]=value;
return true;
}
return false;
Expand All @@ -55,9 +54,9 @@ int brett::besitzer(int x,int y)

if ((x>=0) && (x<8) && (y>0) && (y<8))
{
/*if (f[x+8*y]==' ') { return 0; }
if (f[x+8*y]==' ') { return 0; }
if ((int(f[x+8*y])>='A') && (int(f[x+8*y]<='Z'))) { return 1; }
if ((int(f[x+8*y])>='a') && (int(f[x+8*y]<='z'))) { return 2; }*/
if ((int(f[x+8*y])>='a') && (int(f[x+8*y]<='z'))) { return 2; }
}
return -1;

Expand Down