Unverified Commit 12542d92 authored by Thomas R. Koll's avatar Thomas R. Koll
Browse files

Give Player names

parent 86899472
......@@ -29,8 +29,9 @@ struct Player {
short saturation; // their colour
int stones[6];
unsigned int field;
char* name;
Player();
Player(unsigned int field) : field(field), score(0) {};
Player(unsigned int field, char* name) : field(field), score(0), name(name) {};
};
struct Stone {
......@@ -69,7 +70,7 @@ void throwDice( int dice) {
int turn(Player player) {
#ifdef DEBUG
printf("New turn #%i\n", game.numberOfTurns);
printf("New turn #%i for %s\n", game.numberOfTurns, player.name);
#endif
static int dice;
throwDice(dice);
......@@ -82,8 +83,8 @@ int moveStone(Player player, Stone stone, int value) {
int main() {
game = Game();
srand (time(NULL));
Player playerOne(playerOneField);
Player playerTwo(playerTwoField);
Player playerOne(playerOneField, (char*) "One");
Player playerTwo(playerTwoField, (char*) "Two");
#ifdef DEBUG
printf("Starting game...\n");
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment