Code:
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
class a
{
int q;
public:
a();
};
class m
{
protected:
float pq[10], pau[10], pqq[10], pa[10], pd[10], pp[10], ps[10], pm[10]
, pu[10], pbc[10], puc[10], pu1[10];
int q, x, xx, xxx, t, w, a1, cccc, c2, cccr, r1, r2, ccc;
public:
m(int);
};
a::a()
{
system("CLS");
cout <<"Turn based stratagy game (text) by 1veedo: Release 11.22.3\n"
<<"I hope to have computer operated oponents soon...\n"
<<"Go back to webpages.charter.net/all/project.htm to check for later"
<<" releases.\n"
<<"\nHow many players <=10: ";
cin >> q;// none of that got displayed, the cin dosn't get executed...
m a(q); //shold start the main part, dont think it gets executed eigther
}
m::m (int o)
{
q = o;
t = o;
ccc = 1;
for (x=0;x<q;x++)
{
pa[x] = 0; //tech affence
pd[x] = 0; //tech defence
pp[x] = 200; //population
ps[x] = 10; //states
pm[x] = 100; //money
pu[x] = 20; //units
pbc[x]=10; //unit cost
puc[x]=40; //upgrade cost
}
do
{
t++;
for (x=0; x<q; x++)
{
if (pp[x]==0)
continue;
r1= 1+rand() %5;
r2= 1+rand() %5;
pp[x] *=1+((r1*.75)/10.);
if (ps[x]<=10)
pm[x] += ps[x]*(pp[x]/100.);
if (ps[x] <=7)
pm[x] += (ps[x]*.7)*(pp[x]/100.);
if (ps[x]>10 && ps[x] <15)
pm[x] +=(ps[x]*.7)*(pp[x]/100.);
else
pm[x] += (ps[x]/2.1)*(pp[x]/100.);
if (ps[x]>20)
pm[x] -= (ps[x]/5)*(pp[x]/100.);
puc[x] += (r1*2)-(r2*2);
pbc[x] += (r1/2.)-(r2/2.);
if (pbc[x]<5)
pbc[x]+=4;
if (pbc[x]>20)
pbc[x]-=4;
if (puc[x]<35)
puc[x]+=10;
if (puc[x]>80)
puc[x]-=20;
}
for (x=0;x<q;x++)
{
if (pp[x]==0)
continue;
while(1)
{
//screen(t, x, q, xx, pq, pa, pd, pp, ps, pm, pu, pbc, puc);
cin >> pq[x];
if (pq[x] == 0)
break;
if (pq[x] == 1)
{
// a(x, q, xxx, pq, pau, pa, pd, pp, ps, pm, pu, pu1, a1);
continue;
}
if (pq[x] == 2)
{
// bu(x, pqq, pp, ps, pm, pu, pbc);
continue;
}
if (pq[x] == 3)
{
// bt(x, pq, pa, pd, pm, puc);
continue;
}
} //end while(1)
} //end if
cccc=0;
for(c2=0; c2<q; c2++)
if (pu[c2]>0)
cccc++;
}while(cccc>1);
for(c2=0; c2<q; c2++)
if(ps[c2]>0){
w=c2+1; break;}
cout <<"Player "<<w<<" Wins!\n";
t=0;
cout <<"Play again?(1=yes)\n";
cin >>ccc;
if (ccc!=1)
exit(1);
a cc2();
}
int main()
{
a cc1(); //it does nothing, not eaven displaying the text in it's constructor
do{}while(1);
}
The original program "stra" is at