1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
|
#include<iostream>
#include<ctime>
#include<string>
using namespace std;
char c; //for buy or not places
struct places {
int price;
int rent;
};
void egyptf();
void syriaf();
void paletinef();
void iraqf();
void libyaf();
void sudanf();
void ksaf();
void qatarf();
void moracof();
void lebanonf();
void alegireaf();
void emaratf();
void kuwitf();
void bahrenf();
int dice(int roll)
{
srand((unsigned int)time(NULL));
roll=rand() % 6+1;
cout<<roll<<endl;
cin.get();
return(roll);
}
struct player {
int salary==300;
int fortune;
}playerm,computer;
void player1d()
{
playerm.fortune=1200;
}
int main()
{
int r=0;
int *p;
r=dice(r);
cout<<"this is r:"<<r;
cout<<endl;
p=&r;
switch (*p)
{
case 1:
egyptf();
break;
case 2:
syriaf();
break;
case 3:
paletinef();
break;
case 4:
iraqf();
break;
case 5:
libyaf();
break;
case 6:
sudanf();
break;
default :
ksaf();
break;
}
return 0;
}
void egyptf()
{
bool sell=false;
places egypt;
egypt.price=500;
egypt.rent=50;
cout<<egypt.price<<egypt.rent<<endl;
cout<<"Do u want to buy it?(y/n)";
cin>>c;
if(c='y')
{
playerm.fortune=playerm.fortune-500;
cout<<"now your fortune is:"<<playerm.fortune<<endl;
}
else
main();
}
void syriaf()
{
bool sell=false;
places syria;
syria.price=300;
syria.rent=20;
cout<<"This is free syria:"<<syria.price<<", "<<syria.rent<<endl;
}
void paletinef()
{
bool sell=false;
places palestine;
palestine.price=250;
palestine.rent=25;
cout<<"This is free syria:"<<palestine.price<<", "<<palestine.rent<<endl;
}
void iraqf()
{
bool sell=false;
places iraq;
iraq.price=150;
iraq.rent=35;
cout<<"this is Iraq:"<<iraq.price<<", "<<iraq.rent<<endl;
}
void libyaf()
{
bool sell=false;
places libya;
libya.price=150;
libya.rent=35;
cout<<"this is libya:"<<libya.price<<", "<<libya.rent<<endl;
}
void sudanf()
{
bool sell=false;
places sudan;
sudan.price=150;
sudan.rent=35;
cout<<"this is sudan:"<<sudan.price<<", "<<sudan.rent<<endl;
}
void ksaf()
{
bool sell=false;
places ksa;
ksa.price=150;
ksa.rent=35;
cout<<"this is ksa:"<<ksa.price<<", "<<ksa.rent<<endl;
}
void qatarf()
{
bool sell=false;
places qatar;
qatar.price=150;
qatar.rent=35;
cout<<"this is qatar:"<<qatar.price<<", "<<qatar.rent<<endl;
}
void moracof()
{
bool sell=false;
places moraco;
moraco.price=150;
moraco.rent=35;
cout<<"this is moraco:"<<moraco.price<<", "<<moraco.rent<<endl;
}
void lebanonf()
{
bool sell=false;
places lebanon;
lebanon.price=150;
lebanon.rent=35;
cout<<"this is lebanon:"<<lebanon.price<<", "<<lebanon.rent<<endl;
}
void alegireaf()
{
bool sell=false;
places alegirea;
alegirea.price=150;
alegirea.rent=35;
cout<<"this is alegirea:"<<alegirea.price<<", "<<alegirea.rent<<endl;
}
void emaratf()
{
bool sell=false;
places emarat;
emarat.price=150;
emarat.rent=35;
cout<<"this is alegireaf:"<<emarat.price<<", "<<emarat.rent<<endl;
}
void kuwitf()
{
bool sell=false;
places kuwit;
kuwit.price=150;
kuwit.rent=35;
cout<<"this is alegireaf:"<<kuwit.price<<", "<<kuwit.rent<<endl;
}
void bahrenf()
{
bool sell=false;
places bahren;
bahren.price=150;
bahren.rent=35;
cout<<"this is bahren:"<<bahren.price<<", "<<bahren.rent<<endl;
}
|