Well, I've finally gotten to where I can use some of those
nice features of C++ thanks to all those who helped me here.
I'm still a beginner tho and I'd appreciate it if you guys
and gals would check my work. So here it is my very first
C++ program. The Slot Machine.....
'>>> Page 1 of SLOT.CPP begins here.
#include
#include
#include
#define WHEEL_MAX 13
#define STARTING_CASH 300
class Player{
private:
int Cash;
char Name[14];
public:
Player();
int SpinAgain();
void Pay(int);
void Collect(int);
};
class Wheel{
public:
int top;
int mid;
int bot;
void Spin();
};
class SlotMachine{
private:
Wheel* Left;
Wheel* Middle;
Wheel* Right;
public:
SlotMachine();
~SlotMachine();
void DropHandle();
int Win();
int Jackpot,
Bet;
};
SlotMachine::SlotMachine(){
Bet = 1;
srand( (unsigned) time(NULL));
Left = new Wheel;
Middle = new Wheel;
Right = new Wheel;
}
SlotMachine::~SlotMachine(){
delete Left;
delete Middle;
delete Right;
}
void SlotMachine::DropHandle(){
Left->Spin();
Middle->Spin();
Right->Spin();
'>>> Page 1 of SLOT.CPP ends here. Continued on next page.
*I'm not lost, I'm locationally challenged.
blm
--- FLAME v1.1
---------------
* Origin: Purgatoire BBS, 719-846-0140, Trinidad, CO, V.34 (1:15/7)
|