# Problem in making a game

 Superman HC · July 4, 2015 Hey there... I am trying to create the most popular game of cards in India named as "Teen Patti" where i have used the concept of random generators...Here's d code: #include #include#include#includeusing namespace std;int main(){string arr1[9]={"1","2","3","4","5","6","King","Jack","Queen"};string arr2[4]={"Heart","Diamond","Spade","Clubs"};srand(time(0));for(int i=0;i<=2;i++){    int x = 1+(rand()%8);    int y = 1+(rand()%3);    cout<<"Press enter to play"<

## Replies

 Jon Z. · July 14, 2015 try something like this``//...int xx[3] = {0};int yy[3] = {0};int x;int y;for(int i=0;i<=2;i++){    do{        x = 1+(rand()%8);        y = 1+(rand()%3);    }while(check(xx, yy, x, y) != 0); xx = x; yy = y;     cout<<"Press enter to play"<#include#includeusing namespace std;int main(){string arr1[9]={"1","2","3","4","5","6","King","Jack","Queen"};string arr2[4]={"Heart","Diamond","Spade","Clubs"};srand(time(0));for(int i=0;i<=2;i++){int x = rand()%8;int y = rand()%3;cout<<"Press enter to play"<
• 1

## C++

128,180 followers