c++ task

0 Danny AA · April 7, 2015
I need to build a domino game.
it's a game like the real domino user vs computer.
I need to make few class.
1 stone class
2 pile classs
3 player class
4 game class

Dominoes is a game consisting of 28 pieces called stones. Rectangular game pieces from some of them middle line
Two squares, each with marked points. Commonly used stones with zero to six points.
Each player gets 7 stones. The first player is the player who has a domino with numbers 6-6.
If no one has 6-6 the user starts and he can put any stone he wants.
The second takes out one of his stone and putm at the table.
tha stone is One of the squares is the same one from the edges of the square of stone that is on the table and place it near.
for example 3-6, 6-1, 1-5, 5-3, 3-0......and more.
when there is no suitable stone the player take from the pile more stone untill he get one that can fit.
The game is over one of the two following situations:
1. When one of the players do not remain stone, an actor is declared the winner.
2. When there were no stones in the fund and no player has what lay. In this case the player wins the total
Points on the stones left in him is the smallest.
plllsssssssssssssssssssssss i need help.

Post a Reply


Oldest  Newest  Rating
+1 Danny AA · April 7, 2015
#ifndef STONE_H
#define STONE_H
#include <iostream>
#include <stdlib.h>
using namespace std;
typedef enum { Left = 1, Right = 2 }Flip;

class Stone

int num1, num2;

Flip flipStone(int, int);
Stone(int, int);
~Stone(){ };
void setNum1(int);
void setNum2(int);
bool equal(Flip, Flip);
int getNum1()const { return this->num1; }
int getNum2()const { return this->num2; }
void PrintClose()const;
void PrintOpen()const;


#include "Stone.h"

this->num1 = 0, this->num2 = 0;

Stone::Stone(int n1, int n2) :num1(n1), num2(n2){


void Stone::setNum1(int a) { num1 = a; }

void Stone::setNum2(int b) { num2 = b; }

void Stone:printClose() const
cout << "The stone is closed [][]" << endl;

void Stone:printOpen()const
cout << "The stone is opened" << endl;

bool Stone::equal(Flip a, Flip b)
if (a == b)
return true;
return false;

Flip Stone::flipStone(int s1, int s2)
if (s1 == Right)
s1 = Left;
if (s2 == Left)
s2 = Right;

0 Danny AA · April 7, 2015
And this is the pile class....

#ifndef PILE_H
#define PILE_H

#include <stdlib.h>
#include "Stone.h"

class Pile

Stone* domino;

void PrintOpen() const;
void PrintClose() const;
void shuffle();
Stone returnIndex();


0 Franz Schmidt · April 7, 2015
sorry man but i don't think anybody here will do your homework but looks like you have allready some knowledge and if you have any specific questions you can ask anytime.

So do you have any problems with your code, or are you stuck with a specific problem??
0 Danny AA · April 8, 2015
I don't want anybody will do my homework.
I just need some tips if u can help that's all.

I have probelm at the pile class.
I'm trying to make a func that will print all the stones opened.
and another func that will print all the stones closed.

  • 1



Used in many types of software including music players, video games, and many large scale applications.

Bucky Roberts Administrator