Skip to content

Schach-GUI #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Compiled Object files

*.slo
*.lo
*.o


# Compiled Dynamic libraries

*.so


# Compiled Static libraries

*.lai
*.la
*.a


# Output files

*.exe
*.d


#Eclipse Folder

.settings
Debug
.cproject
.project
.metadata

#Bilder
*.bmp

36 changes: 36 additions & 0 deletions Chess/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Compiled Object files

*.slo
*.lo
*.o


# Compiled Dynamic libraries

*.so


# Compiled Static libraries

*.lai
*.la
*.a


# Output files

*.exe
*.d


#Eclipse Folder

.settings
Debug
.cproject
.project
.metadata

#Bilder
*.bmp

54 changes: 54 additions & 0 deletions Chess/Interface/interface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* interface.cpp
*
* Created on: 30.05.2012
* Author: Thomas
*/

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

void Interface::einlesen(int p)
{
do
{
std::cout << "Spieler " << p << ": Bitte Zug eingeben: ";
std::cin >> p1a >> p1b >> p2a >> p2b;

if (std::cin.fail()==false)
{
break;
}
else
{
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
}
while (true);

}

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 << b->lese(j,i) << " ";
}
std::cout << std::endl;
}

}

void Interface::winner(int player)
{

}

26 changes: 26 additions & 0 deletions Chess/Interface/interface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* interface.h
*
* Created on: 30.05.2012
* Author: Thomas
*/

#ifndef INTERFACE_H_
#define INTERFACE_H_

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

class Interface
{
public:
void ausgabe(brett* b);
void einlesen(int p);
void winner(int player);

char p1a,p2a;
int p1b,p2b;
};


#endif /* INTERFACE_H_ */
Loading